home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / apps.to.go / •AppsToGo Reference / •AppsToGo Reference.rsrc / WFMT_529_a270 < prev    next >
Unknown  |  1994-07-14  |  16.6 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was not able to be converted.
This format is not currently supported by dexvert.

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert Jesper Olsen Module (music/jesperOlsen) magic Supported
1% dexvert TTComp Archive (archive/ttcomp) fallback Supported
100% file TTComp archive data, binary, 2K dictionary default (weak)
99% file data default
66% TrID TTComp archive compressed (bin-2K) default (weak)
33% TrID Adobe PhotoShop Brush default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 05 00 01 00 00 00 1a | 00 00 00 00 00 00 00 1a |........|........|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 05 00 05 00 00 |........|........|
|00000030| 00 22 00 00 09 77 00 00 | 00 22 61 32 37 30 00 00 |."...w..|."a270..|
|00000040| 4e 16 00 00 20 19 00 00 | 00 00 00 00 00 00 00 00 |N... ...|........|
|00000050| 00 00 08 4e 65 77 4c 61 | 79 65 72 00 00 06 00 00 |...NewLa|yer.....|
|00000060| 00 00 00 db 00 00 09 78 | 00 00 00 db 00 00 00 14 |.......x|........|
|00000070| 03 c1 00 28 05 7e 00 ff | 00 00 00 00 00 00 0f a8 |...(.~..|........|
|00000080| 00 00 00 00 4e 1c 00 00 | 00 09 00 00 00 04 00 04 |....N...|........|
|00000090| ff fc ff fa 00 04 00 04 | ff fc ff fc 00 00 00 00 |........|........|
|000000a0| 00 00 00 00 83 00 0b 40 | 10 6b 53 63 72 65 65 6e |.......@|.kScreen|
|000000b0| 41 50 49 2f 31 39 39 39 | 36 00 06 47 65 6e 65 76 |API/1999|6..Genev|
|000000c0| 61 00 00 81 4f 53 45 72 | 72 20 4e 65 77 4c 61 79 |a...OSEr|r NewLay|
|000000d0| 65 72 28 4c 61 79 65 72 | 4f 62 6a 20 2a 6e 65 77 |er(Layer|Obj *new|
|000000e0| 4c 61 79 65 72 2c 20 4c | 61 79 65 72 4f 62 6a 20 |Layer, L|ayerObj |
|000000f0| 61 62 6f 76 65 4c 61 79 | 65 72 2c 20 4c 61 79 65 |aboveLay|er, Laye|
|00000100| 72 50 72 6f 63 20 74 68 | 65 50 72 6f 63 2c 20 47 |rProc th|eProc, G|
|00000110| 72 61 66 50 74 72 20 62 | 61 73 65 50 6f 72 74 2c |rafPtr b|asePort,|
|00000120| 20 73 68 6f 72 74 20 64 | 65 70 74 68 2c 20 75 6e | short d|epth, un|
|00000130| 73 69 67 6e 65 64 20 6c | 6f 6e 67 20 74 68 65 44 |signed l|ong theD|
|00000140| 61 74 61 29 3b 00 00 00 | 06 00 00 00 00 00 8a 00 |ata);...|........|
|00000150| 00 09 79 00 00 00 8a 00 | 00 00 00 03 c1 00 14 05 |..y.....|........|
|00000160| 7e 00 ff 00 00 00 00 00 | 00 0f a8 00 00 00 00 4e |~.......|.......N|
|00000170| 1d 00 00 00 09 00 00 00 | 04 00 04 ff fc ff fa 00 |........|........|
|00000180| 04 00 04 ff fc ff fc 00 | 00 00 00 00 00 00 00 83 |........|........|
|00000190| 00 0b 40 14 6b 53 63 72 | 65 65 6e 4f 6e 65 4c 69 |..@.kScr|eenOneLi|
|000001a0| 6e 65 2f 31 39 39 39 37 | 00 06 47 65 6e 65 76 61 |ne/19997|..Geneva|
|000001b0| 00 00 2c 43 72 65 61 74 | 65 20 61 20 6c 61 79 65 |..,Creat|e a laye|
|000001c0| 72 20 6f 62 6a 65 63 74 | 20 66 6f 72 20 6f 66 66 |r object| for off|
|000001d0| 73 63 72 65 65 6e 20 64 | 72 61 77 69 6e 67 2e 00 |screen d|rawing..|
|000001e0| 00 00 06 00 00 00 00 00 | 44 00 00 09 7a 00 00 00 |........|D...z...|
|000001f0| 44 00 00 00 00 02 6b 04 | 40 02 6c 01 00 00 00 00 |D.....k.|@.l.....|
|00000200| 00 00 01 0f f1 00 00 00 | 00 00 00 00 00 00 0c 00 |........|........|
|00000210| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000220| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000230| 00 00 00 00 00 00 06 00 | 00 00 00 00 b9 00 00 09 |........|........|
|00000240| 7b 00 00 00 b9 00 00 00 | 00 02 6b 02 28 03 c1 00 |{.......|..k.(...|
|00000250| ff 00 00 00 00 00 00 0f | a8 00 00 00 00 4e 16 00 |........|.....N..|
|00000260| 00 00 09 00 00 00 04 00 | 04 ff fc ff fa 00 04 00 |........|........|
|00000270| 04 ff fc ff fc 00 00 00 | 00 00 00 00 00 83 00 0b |........|........|
|00000280| 40 0b 6c 69 6e 6b 73 2f | 31 39 39 39 30 00 06 4d |@.links/|19990..M|
|00000290| 6f 6e 61 63 6f 00 00 4e | 61 31 42 38 2c 44 69 73 |onaco..N|a1B8,Dis|
|000002a0| 70 6f 73 65 54 68 69 73 | 41 6e 64 42 65 6c 6f 77 |poseThis|AndBelow|
|000002b0| 4c 61 79 65 72 73 0d 61 | 32 35 37 2c 49 6e 76 61 |Layers.a|257,Inva|
|000002c0| 6c 4c 61 79 65 72 0d 61 | 32 37 30 2c 4e 65 77 4c |lLayer.a|270,NewL|
|000002d0| 61 79 65 72 0d 61 32 44 | 45 2c 55 70 64 61 74 65 |ayer.a2D|E,Update|
|000002e0| 4c 61 79 65 72 0d 00 16 | 00 01 00 00 00 00 00 10 |Layer...|........|
|000002f0| 00 0c 00 01 00 00 00 00 | 00 00 00 00 00 00 00 06 |........|........|
|00000300| 00 00 00 00 3f 86 00 00 | 09 7c 00 00 3f 86 00 00 |....?...|.|..?...|
|00000310| 00 00 00 00 75 30 02 6b | 01 ff 00 00 00 00 00 00 |....u0.k|........|
|00000320| 0f a8 00 00 00 00 4e 1f | 00 00 00 09 00 00 00 04 |......N.|........|
|00000330| 00 04 ff fc ff fa 00 04 | 00 04 ff fc ff fc 00 00 |........|........|
|00000340| 00 00 00 00 00 00 83 00 | 0b 40 0a 62 6f 64 79 2f |........|.@.body/|
|00000350| 31 39 39 39 39 00 06 4d | 6f 6e 61 63 6f 00 3e 04 |19999..M|onaco.>.|
|00000360| 4f 53 45 72 72 20 4e 65 | 77 4c 61 79 65 72 28 4c |OSErr Ne|wLayer(L|
|00000370| 61 79 65 72 4f 62 6a 20 | 2a 6e 65 77 4c 61 79 65 |ayerObj |*newLaye|
|00000380| 72 2c 20 4c 61 79 65 72 | 4f 62 6a 20 61 62 6f 76 |r, Layer|Obj abov|
|00000390| 65 4c 61 79 65 72 2c 20 | 4c 61 79 65 72 50 72 6f |eLayer, |LayerPro|
|000003a0| 63 20 74 68 65 50 72 6f | 63 2c 20 47 72 61 66 50 |c thePro|c, GrafP|
|000003b0| 74 72 20 62 61 73 65 50 | 6f 72 74 2c 20 73 68 6f |tr baseP|ort, sho|
|000003c0| 72 74 20 64 65 70 74 68 | 2c 20 75 6e 73 69 67 6e |rt depth|, unsign|
|000003d0| 65 64 20 6c 6f 6e 67 20 | 74 68 65 44 61 74 61 29 |ed long |theData)|
|000003e0| 3b 0d 0d 49 4e 50 55 54 | 3a 20 20 61 62 6f 76 65 |;..INPUT|: above|
|000003f0| 4c 61 79 65 72 20 20 20 | 20 20 20 54 68 69 73 20 |Layer | This |
|00000400| 69 73 20 74 68 65 20 6c | 61 79 65 72 20 61 62 6f |is the l|ayer abo|
|00000410| 76 65 20 74 68 65 20 6c | 61 79 65 72 20 74 6f 20 |ve the l|ayer to |
|00000420| 63 72 65 61 74 65 2e 0d | 20 20 20 20 20 20 20 20 |create..| |
|00000430| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000440| 49 66 20 74 68 65 20 6c | 61 79 65 72 20 69 73 20 |If the l|ayer is |
|00000450| 74 6f 20 62 65 20 74 68 | 65 20 74 6f 70 20 6c 61 |to be th|e top la|
|00000460| 79 65 72 2c 20 74 68 65 | 6e 20 70 61 73 73 20 6e |yer, the|n pass n|
|00000470| 69 6c 20 68 65 72 65 2e | 0d 20 20 20 20 20 20 20 |il here.|. |
|00000480| 20 74 68 65 50 72 6f 63 | 20 20 20 20 20 20 20 20 | theProc| |
|00000490| 20 54 68 65 20 70 72 6f | 63 65 64 75 72 65 20 70 | The pro|cedure p|
|000004a0| 6f 69 6e 74 65 72 20 66 | 6f 72 20 74 68 65 20 6c |ointer f|or the l|
|000004b0| 61 79 65 72 20 6f 62 6a | 65 63 74 2e 20 20 49 66 |ayer obj|ect. If|
|000004c0| 20 74 68 65 20 64 65 66 | 61 75 6c 74 0d 20 20 20 | the def|ault. |
|000004d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000004e0| 20 20 20 20 20 61 63 74 | 69 6f 6e 73 20 61 72 65 | act|ions are|
|000004f0| 20 61 6c 6c 20 6f 6b 61 | 79 2c 20 74 68 65 6e 20 | all oka|y, then |
|00000500| 70 61 73 73 20 69 6e 20 | 6e 69 6c 20 68 65 72 65 |pass in |nil here|
|00000510| 2e 0d 20 20 20 20 20 20 | 20 20 62 61 73 65 50 6f |.. | basePo|
|00000520| 72 74 20 20 20 20 20 20 | 20 20 49 66 20 79 6f 75 |rt | If you|
|00000530| 20 70 61 73 73 20 69 6e | 20 61 20 70 6f 72 74 20 | pass in| a port |
|00000540| 68 65 72 65 2c 20 74 68 | 65 6e 20 4e 65 77 4c 61 |here, th|en NewLa|
|00000550| 79 65 72 20 77 6f 6e d5 | 74 20 63 72 65 61 74 65 |yer won.|t create|
|00000560| 20 6f 6e 65 0d 20 20 20 | 20 20 20 20 20 20 20 20 | one. | |
|00000570| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 66 6f 72 | | for|
|00000580| 20 79 6f 75 2e 20 20 49 | 66 20 6e 6f 20 70 6f 72 | you. I|f no por|
|00000590| 74 20 69 73 20 70 61 73 | 73 65 64 20 69 6e 2c 20 |t is pas|sed in, |
|000005a0| 74 68 65 6e 20 69 74 20 | 77 69 6c 6c 20 63 72 65 |then it |will cre|
|000005b0| 61 74 65 20 61 6e 0d 20 | 20 20 20 20 20 20 20 20 |ate an. | |
|000005c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 6f | | o|
|000005d0| 66 66 73 63 72 65 65 6e | 20 47 57 6f 72 6c 64 20 |ffscreen| GWorld |
|000005e0| 28 6f 72 20 70 6f 72 74 | 20 66 6f 72 20 73 79 73 |(or port| for sys|
|000005f0| 74 65 6d 20 36 29 2c 20 | 62 61 73 65 64 20 6f 6e |tem 6), |based on|
|00000600| 20 74 68 65 20 73 69 7a | 65 2f 64 65 70 74 68 0d | the siz|e/depth.|
|00000610| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000620| 20 20 20 20 20 20 20 20 | 6f 66 20 74 68 65 20 6c | |of the l|
|00000630| 61 79 65 72 20 61 62 6f | 76 65 20 28 61 6e 64 20 |ayer abo|ve (and |
|00000640| 73 6f 6d 65 20 6f 74 68 | 65 72 20 66 61 63 74 6f |some oth|er facto|
|00000650| 72 73 29 2e 0d 20 20 20 | 20 20 20 20 20 64 65 70 |rs).. | dep|
|00000660| 74 68 20 20 20 20 20 20 | 20 20 20 20 20 54 68 65 |th | The|
|00000670| 20 64 65 70 74 68 20 74 | 6f 20 63 72 65 61 74 65 | depth t|o create|
|00000680| 20 74 68 65 20 6f 66 66 | 73 63 72 65 65 6e 2e 20 | the off|screen. |
|00000690| 20 49 66 20 30 20 69 73 | 20 70 61 73 73 65 64 20 | If 0 is| passed |
|000006a0| 69 6e 2c 20 74 68 65 6e | 0d 20 20 20 20 20 20 20 |in, then|. |
|000006b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000006c0| 20 74 68 65 20 64 65 70 | 74 68 20 69 73 20 62 61 | the dep|th is ba|
|000006d0| 73 65 64 20 6f 6e 20 74 | 68 65 20 61 62 6f 76 65 |sed on t|he above|
|000006e0| 20 70 6f 72 74 2e 0d 20 | 20 20 20 20 20 20 20 74 | port.. | t|
|000006f0| 68 65 44 61 74 61 20 20 | 20 20 20 20 20 20 20 41 |heData | A|
|00000700| 70 70 6c 69 63 61 74 69 | 6f 6e 20 72 65 66 65 72 |pplicati|on refer|
|00000710| 65 6e 63 65 20 66 69 65 | 6c 64 2e 20 20 53 74 6f |ence fie|ld. Sto|
|00000720| 72 65 20 77 68 61 74 65 | 76 65 72 20 79 6f 75 20 |re whate|ver you |
|00000730| 77 61 6e 74 20 68 65 72 | 65 2e 0d 4f 55 54 50 55 |want her|e..OUTPU|
|00000740| 54 3a 20 6e 65 77 4c 61 | 79 65 72 20 20 20 20 20 |T: newLa|yer |
|00000750| 20 20 20 49 66 20 73 75 | 63 63 65 73 73 66 75 6c | If su|ccessful|
|00000760| 2c 20 61 20 4c 61 79 65 | 72 4f 62 6a 20 68 61 6e |, a Laye|rObj han|
|00000770| 64 6c 65 20 77 69 6c 6c | 20 62 65 20 72 65 74 75 |dle will| be retu|
|00000780| 72 6e 65 64 20 68 65 72 | 65 2e 0d 20 20 20 20 20 |rned her|e.. |
|00000790| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000007a0| 20 20 20 49 66 20 75 6e | 73 75 63 63 65 73 73 66 | If un|successf|
|000007b0| 75 6c 2c 20 61 20 6e 69 | 6c 20 77 69 6c 6c 20 62 |ul, a ni|l will b|
|000007c0| 65 20 72 65 74 75 72 6e | 65 64 20 68 65 72 65 2e |e return|ed here.|
|000007d0| 0d 52 45 53 55 4c 54 3a | 20 4f 53 45 72 72 20 20 |.RESULT:| OSErr |
|000007e0| 20 20 20 20 20 20 20 20 | 20 54 68 65 20 6d 6f 73 | | The mos|
|000007f0| 74 20 6c 69 6b 65 6c 79 | 20 65 72 72 6f 72 20 69 |t likely| error i|
|00000800| 73 20 6d 65 6d 46 75 6c | 6c 45 72 72 2e 0d 0d 47 |s memFul|lErr...G|
|00000810| 57 4c 61 79 65 72 73 20 | 69 73 20 6d 65 61 6e 74 |WLayers |is meant|
|00000820| 20 74 6f 20 73 69 6d 70 | 6c 69 66 79 20 61 6e 64 | to simp|lify and|
|00000830| 20 73 74 61 6e 64 61 72 | 64 69 7a 65 20 6f 66 66 | standar|dize off|
|00000840| 73 63 72 65 65 6e 20 64 | 72 61 77 69 6e 67 20 69 |screen d|rawing i|
|00000850| 6e 20 61 20 66 6c 65 78 | 69 62 6c 65 20 77 61 79 |n a flex|ible way|
|00000860| 2e 0d 0d 4e 4f 54 45 3a | 20 20 20 54 68 69 73 20 |...NOTE:| This |
|00000870| 70 61 63 6b 61 67 65 20 | 77 61 73 20 6f 72 69 67 |package |was orig|
|00000880| 69 6e 61 6c 6c 79 20 77 | 72 69 74 74 65 6e 20 66 |inally w|ritten f|
|00000890| 6f 72 20 75 73 65 20 77 | 69 74 68 20 47 57 6f 72 |or use w|ith GWor|
|000008a0| 6c 64 73 2c 20 62 75 74 | 20 73 79 73 74 65 6d 20 |lds, but| system |
|000008b0| 36 0d 20 20 20 20 20 20 | 20 20 73 75 70 70 6f 72 |6. | suppor|
|000008c0| 74 20 68 61 73 20 62 65 | 65 6e 20 61 64 64 65 64 |t has be|en added|
|000008d0| 2e 20 20 59 6f 75 20 6e | 6f 20 6c 6f 6e 67 65 72 |. You n|o longer|
|000008e0| 20 6e 65 65 64 20 73 79 | 73 74 65 6d 20 37 20 6f | need sy|stem 7 o|
|000008f0| 72 20 63 6f 6c 6f 72 20 | 71 75 69 63 6b 64 72 61 |r color |quickdra|
|00000900| 77 0d 20 20 20 20 20 20 | 20 20 74 6f 20 75 73 65 |w. | to use|
|00000910| 20 74 68 69 73 20 70 61 | 63 6b 61 67 65 2e 0d 0d | this pa|ckage...|
|00000920| 55 73 69 6e 67 20 6f 66 | 66 73 63 72 65 65 6e 20 |Using of|fscreen |
|00000930| 47 57 6f 72 6c 64 73 20 | 61 6c 6c 6f 77 73 20 61 |GWorlds |allows a|
|00000940| 70 70 6c 69 63 61 74 69 | 6f 6e 73 20 74 6f 20 61 |pplicati|ons to a|
|00000950| 63 68 69 65 76 65 20 76 | 65 72 79 20 63 6c 65 61 |chieve v|ery clea|
|00000960| 6e 20 67 72 61 70 68 69 | 63 73 0d 65 66 66 65 63 |n graphi|cs.effec|
|00000970| 74 73 20 74 68 61 74 20 | 61 72 65 20 6e 6f 74 20 |ts that |are not |
|00000980| 70 6f 73 73 69 62 6c 65 | 20 69 66 20 64 72 61 77 |possible| if draw|
|00000990| 69 6e 67 20 64 69 72 65 | 63 74 6c 79 20 74 6f 20 |ing dire|ctly to |
|000009a0| 61 20 77 69 6e 64 6f 77 | 20 28 6f 72 20 67 72 61 |a window| (or gra|
|000009b0| 66 50 6f 72 74 29 2e 0d | 49 6e 20 6d 6f 73 74 20 |fPort)..|In most |
|000009c0| 63 61 73 65 73 2c 20 77 | 68 65 6e 20 61 6e 20 69 |cases, w|hen an i|
|000009d0| 6d 61 67 65 20 69 73 20 | 67 65 6e 65 72 61 74 65 |mage is |generate|
|000009e0| 64 20 69 6e 20 61 6e 20 | 6f 66 66 73 63 72 65 65 |d in an |offscree|
|000009f0| 6e 20 47 57 6f 72 6c 64 | 2c 20 74 68 61 74 20 69 |n GWorld|, that i|
|00000a00| 6d 61 67 65 0d 77 69 6c | 6c 20 65 6e 64 20 75 70 |mage.wil|l end up|
|00000a10| 20 62 65 69 6e 67 20 64 | 69 73 70 6c 61 79 65 64 | being d|isplayed|
|00000a20| 20 69 6e 20 61 20 77 69 | 6e 64 6f 77 2e 0d 0d 54 | in a wi|ndow...T|
|00000a30| 68 69 73 20 72 65 6c 61 | 74 69 6f 6e 73 68 69 70 |his rela|tionship|
|00000a40| 20 62 65 74 77 65 65 6e | 20 6f 66 66 73 63 72 65 | between| offscre|
|00000a50| 65 6e 20 47 57 6f 72 6c | 64 73 20 61 6e 64 20 77 |en GWorl|ds and w|
|00000a60| 69 6e 64 6f 77 73 20 6e | 65 65 64 73 20 74 6f 20 |indows n|eeds to |
|00000a70| 62 65 20 6d 61 6e 61 67 | 65 64 2e 0d 49 6e 20 61 |be manag|ed..In a|
|00000a80| 64 64 69 74 69 6f 6e 20 | 74 6f 20 6f 6e 65 20 47 |ddition |to one G|
|00000a90| 57 6f 72 6c 64 20 72 65 | 6c 61 74 69 6e 67 20 74 |World re|lating t|
|00000aa0| 6f 20 61 20 77 69 6e 64 | 6f 77 2c 20 79 6f 75 20 |o a wind|ow, you |
|00000ab0| 6d 61 79 20 61 63 74 75 | 61 6c 6c 79 20 6e 65 65 |may actu|ally nee|
|00000ac0| 64 20 6d 75 6c 74 69 70 | 6c 65 0d 47 57 6f 72 6c |d multip|le.GWorl|
|00000ad0| 64 73 20 74 6f 20 72 65 | 6c 61 74 65 20 74 6f 20 |ds to re|late to |
|00000ae0| 61 20 77 69 6e 64 6f 77 | 2e 20 20 4d 61 6e 79 20 |a window|. Many |
|00000af0| 65 66 66 65 63 74 73 20 | 64 65 6d 61 6e 64 20 6d |effects |demand m|
|00000b00| 6f 72 65 20 74 68 61 6e | 20 6f 6e 65 20 6f 66 66 |ore than| one off|
|00000b10| 73 63 72 65 65 6e 0d 47 | 57 6f 72 6c 64 2e 20 20 |screen.G|World. |
|00000b20| 53 6d 6f 6f 74 68 6c 79 | 20 64 72 61 67 67 69 6e |Smoothly| draggin|
|00000b30| 67 20 61 6e 20 69 6d 61 | 67 65 20 6f 76 65 72 20 |g an ima|ge over |
|00000b40| 61 20 62 61 63 6b 67 72 | 6f 75 6e 64 20 69 73 20 |a backgr|ound is |
|00000b50| 6f 6e 65 20 73 75 63 68 | 20 65 66 66 65 63 74 2e |one such| effect.|
|00000b60| 0d 0d 47 57 4c 61 79 65 | 72 73 2e 63 20 69 73 20 |..GWLaye|rs.c is |
|00000b70| 61 20 62 6c 6f 63 6b 20 | 6f 66 20 63 6f 64 65 20 |a block |of code |
|00000b80| 74 68 61 74 20 6d 61 6e | 61 67 65 73 20 74 68 65 |that man|ages the|
|00000b90| 20 6d 6f 72 65 20 6d 75 | 6e 64 61 6e 65 20 61 73 | more mu|ndane as|
|00000ba0| 70 65 63 74 73 20 6f 66 | 20 68 61 6e 64 6c 69 6e |pects of| handlin|
|00000bb0| 67 20 6f 6e 65 0d 6f 72 | 20 6d 6f 72 65 20 47 57 |g one.or| more GW|
|00000bc0| 6f 72 6c 64 73 2e 20 20 | 47 57 4c 61 79 65 72 73 |orlds. |GWLayers|
|00000bd0| 2e 63 20 67 69 76 65 73 | 20 79 6f 75 20 61 20 63 |.c gives| you a c|
|00000be0| 6f 6e 73 69 73 74 65 6e | 74 20 77 61 79 20 6f 66 |onsisten|t way of|
|00000bf0| 20 72 65 6c 61 74 69 6e | 67 20 47 57 6f 72 6c 64 | relatin|g GWorld|
|00000c00| 73 2f 77 69 6e 64 6f 77 | 73 0d 74 6f 67 65 74 68 |s/window|s.togeth|
|00000c10| 65 72 2e 0d 0d 41 20 63 | 6f 6d 6d 6f 6e 20 75 73 |er...A c|ommon us|
|00000c20| 65 20 66 6f 72 20 6f 66 | 66 73 63 72 65 65 6e 20 |e for of|fscreen |
|00000c30| 47 57 6f 72 6c 64 73 20 | 69 73 20 74 6f 20 6d 6f |GWorlds |is to mo|
|00000c40| 76 65 20 61 6e 20 6f 62 | 6a 65 63 74 20 61 72 6f |ve an ob|ject aro|
|00000c50| 75 6e 64 20 69 6e 20 61 | 20 77 69 6e 64 6f 77 20 |und in a| window |
|00000c60| 73 6d 6f 6f 74 68 6c 79 | 0d 6f 76 65 72 20 61 20 |smoothly|.over a |
|00000c70| 62 61 63 6b 67 72 6f 75 | 6e 64 2e 20 20 54 6f 20 |backgrou|nd. To |
|00000c80| 61 63 63 6f 6d 70 6c 69 | 73 68 20 74 68 69 73 2c |accompli|sh this,|
|00000c90| 20 77 65 20 6e 65 65 64 | 20 33 20 6c 61 79 65 72 | we need| 3 layer|
|00000ca0| 73 2e 0d 54 68 65 73 65 | 20 61 72 65 3a 0d 0d 31 |s..These| are:..1|
|00000cb0| 29 20 20 54 68 65 20 77 | 69 6e 64 6f 77 20 6c 61 |) The w|indow la|
|00000cc0| 79 65 72 2e 20 20 54 68 | 69 73 20 69 73 20 74 68 |yer. Th|is is th|
|00000cd0| 65 20 74 6f 70 2d 6d 6f | 73 74 20 6c 61 79 65 72 |e top-mo|st layer|
|00000ce0| 20 69 6e 20 74 68 65 20 | 6c 61 79 65 72 20 68 69 | in the |layer hi|
|00000cf0| 65 72 61 72 63 68 79 2e | 20 20 54 68 65 0d 20 20 |erarchy.| The. |
|00000d00| 20 20 74 6f 70 2d 6d 6f | 73 74 20 6c 61 79 65 72 | top-mo|st layer|
|00000d10| 20 69 73 20 74 79 70 69 | 63 61 6c 6c 79 20 77 68 | is typi|cally wh|
|00000d20| 61 74 20 74 68 65 20 75 | 73 65 72 20 77 69 6c 6c |at the u|ser will|
|00000d30| 20 73 65 65 2c 20 61 6e | 64 20 74 68 65 72 65 66 | see, an|d theref|
|00000d40| 6f 72 65 20 63 6f 6d 6d | 6f 6e 6c 79 0d 20 20 20 |ore comm|only. |
|00000d50| 20 69 73 20 61 20 77 69 | 6e 64 6f 77 20 6c 61 79 | is a wi|ndow lay|
|00000d60| 65 72 2e 20 20 4c 61 79 | 65 72 73 20 62 65 6c 6f |er. Lay|ers belo|
|00000d70| 77 20 74 68 65 20 74 6f | 70 2d 6d 6f 73 74 20 61 |w the to|p-most a|
|00000d80| 72 65 20 74 79 70 69 63 | 61 6c 6c 79 20 6f 66 66 |re typic|ally off|
|00000d90| 73 63 72 65 65 6e 0d 20 | 20 20 20 47 57 6f 72 6c |screen. | GWorl|
|00000da0| 64 73 2e 0d 32 29 20 20 | 41 20 6d 69 64 64 6c 65 |ds..2) |A middle|
|00000db0| 20 6c 61 79 65 72 20 74 | 68 61 74 20 69 73 20 75 | layer t|hat is u|
|00000dc0| 73 65 64 20 74 6f 20 61 | 70 70 6c 79 20 74 68 65 |sed to a|pply the|
|00000dd0| 20 6f 62 6a 65 63 74 20 | 62 65 69 6e 67 20 6d 6f | object |being mo|
|00000de0| 76 65 64 20 74 6f 20 74 | 68 65 0d 20 20 20 20 62 |ved to t|he. b|
|00000df0| 61 63 6b 67 72 6f 75 6e | 64 20 70 6c 75 73 20 72 |ackgroun|d plus r|
|00000e00| 65 6d 6f 76 69 6e 67 20 | 74 68 65 20 6f 62 6a 65 |emoving |the obje|
|00000e10| 63 74 20 66 72 6f 6d 20 | 74 68 65 20 6f 6c 64 20 |ct from |the old |
|00000e20| 6c 6f 63 61 74 69 6f 6e | 2e 20 20 4f 6e 63 65 20 |location|. Once |
|00000e30| 74 68 65 73 65 0d 20 20 | 20 20 74 77 6f 20 74 61 |these. | two ta|
|00000e40| 73 6b 73 20 61 72 65 20 | 64 6f 6e 65 2c 20 74 68 |sks are |done, th|
|00000e50| 65 20 6f 66 66 73 63 72 | 65 65 6e 20 77 6f 72 6b |e offscr|een work|
|00000e60| 20 61 72 65 61 20 69 73 | 20 72 65 61 64 79 20 74 | area is| ready t|
|00000e70| 6f 20 62 65 20 74 72 61 | 6e 73 66 65 72 72 65 64 |o be tra|nsferred|
|00000e80| 0d 20 20 20 20 74 6f 20 | 74 68 65 20 77 69 6e 64 |. to |the wind|
|00000e90| 6f 77 20 6c 61 79 65 72 | 2e 0d 33 29 20 20 41 20 |ow layer|..3) A |
|00000ea0| 62 61 63 6b 67 72 6f 75 | 6e 64 20 69 6d 61 67 65 |backgrou|nd image|
|00000eb0| 20 61 67 61 69 6e 73 74 | 20 77 68 69 63 68 20 74 | against| which t|
|00000ec0| 68 65 20 6f 62 6a 65 63 | 74 20 6d 6f 76 65 73 2e |he objec|t moves.|
|00000ed0| 20 20 54 68 69 73 20 69 | 73 20 75 73 65 64 20 74 | This i|s used t|
|00000ee0| 6f 0d 20 20 20 20 72 65 | 73 74 6f 72 65 20 74 68 |o. re|store th|
|00000ef0| 65 20 6d 69 64 64 6c 65 | 20 6c 61 79 65 72 20 61 |e middle| layer a|
|00000f00| 74 20 74 68 65 20 6c 6f | 63 61 74 69 6f 6e 20 77 |t the lo|cation w|
|00000f10| 68 65 72 65 20 74 68 65 | 20 6f 62 6a 65 63 74 20 |here the| object |
|00000f20| 62 65 69 6e 67 20 6d 6f | 76 65 64 0d 20 20 20 20 |being mo|ved. |
|00000f30| 77 61 73 20 6c 61 73 74 | 20 61 74 2e 0d 0d 54 68 |was last| at...Th|
|00000f40| 65 20 62 61 63 6b 67 72 | 6f 75 6e 64 20 6c 61 79 |e backgr|ound lay|
|00000f50| 65 72 20 69 73 20 67 65 | 6e 65 72 61 74 65 64 20 |er is ge|nerated |
|00000f60| 6f 6e 6c 79 20 6f 6e 63 | 65 2e 20 20 54 68 65 20 |only onc|e. The |
|00000f70| 72 65 6c 65 76 61 6e 74 | 20 28 63 68 61 6e 67 69 |relevant| (changi|
|00000f80| 6e 67 29 20 70 6f 72 74 | 69 6f 6e 73 20 6f 66 0d |ng) port|ions of.|
|00000f90| 74 68 65 20 62 61 63 6b | 67 72 6f 75 6e 64 20 69 |the back|ground i|
|00000fa0| 6d 61 67 65 20 61 72 65 | 20 63 6f 70 69 65 64 20 |mage are| copied |
|00000fb0| 69 6e 74 6f 20 74 68 65 | 20 6d 69 64 64 6c 65 20 |into the| middle |
|00000fc0| 6c 61 79 65 72 2e 20 20 | 4f 6e 63 65 20 74 68 65 |layer. |Once the|
|00000fd0| 20 62 61 63 6b 67 72 6f | 75 6e 64 20 70 6f 72 74 | backgro|und port|
|00000fe0| 69 6f 6e 0d 69 73 20 63 | 6f 70 69 65 64 20 69 6e |ion.is c|opied in|
|00000ff0| 74 6f 20 74 68 65 20 6d | 69 64 64 6c 65 20 6c 61 |to the m|iddle la|
|00001000| 79 65 72 2c 20 74 68 65 | 20 6f 62 6a 65 63 74 20 |yer, the| object |
|00001010| 74 68 61 74 20 69 73 20 | 6d 6f 76 69 6e 67 20 61 |that is |moving a|
|00001020| 63 72 6f 73 73 20 74 68 | 65 20 62 61 63 6b 67 72 |cross th|e backgr|
|00001030| 6f 75 6e 64 20 69 73 0d | 64 72 61 77 6e 20 69 6e |ound is.|drawn in|
|00001040| 74 6f 20 74 68 65 20 6d | 69 64 64 6c 65 20 6c 61 |to the m|iddle la|
|00001050| 79 65 72 20 6f 6e 20 74 | 6f 70 20 6f 66 20 74 68 |yer on t|op of th|
|00001060| 65 20 62 61 63 6b 67 72 | 6f 75 6e 64 20 70 6f 72 |e backgr|ound por|
|00001070| 74 69 6f 6e 2e 0d 0d 4f | 6e 63 65 20 74 68 65 20 |tion...O|nce the |
|00001080| 6d 69 64 64 6c 65 20 6c | 61 79 65 72 20 68 61 73 |middle l|ayer has|
|00001090| 20 74 68 65 20 62 61 63 | 6b 67 72 6f 75 6e 64 20 | the bac|kground |
|000010a0| 70 6f 72 74 69 6f 6e 20 | 77 69 74 68 20 74 68 65 |portion |with the|
|000010b0| 20 6d 6f 76 69 6e 67 20 | 6f 62 6a 65 63 74 20 64 | moving |object d|
|000010c0| 72 61 77 6e 20 6f 6e 74 | 6f 20 69 74 2c 0d 74 68 |rawn ont|o it,.th|
|000010d0| 65 20 70 6f 72 74 69 6f | 6e 20 69 73 20 74 72 61 |e portio|n is tra|
|000010e0| 6e 73 66 65 72 72 65 64 | 20 74 6f 20 74 68 65 20 |nsferred| to the |
|000010f0| 74 6f 70 2d 6d 6f 73 74 | 20 6c 61 79 65 72 2c 20 |top-most| layer, |
|00001100| 77 68 69 63 68 20 69 73 | 20 74 68 65 20 77 69 6e |which is| the win|
|00001110| 64 6f 77 20 6c 61 79 65 | 72 2e 20 20 54 68 65 20 |dow laye|r. The |
|00001120| 75 73 65 72 0d 73 65 65 | 73 20 6f 6e 6c 79 20 74 |user.see|s only t|
|00001130| 68 69 73 20 66 69 6e 61 | 6c 20 74 72 61 6e 73 66 |his fina|l transf|
|00001140| 65 72 2c 20 73 6f 20 74 | 68 65 20 69 6e 74 65 72 |er, so t|he inter|
|00001150| 6d 65 64 69 61 74 65 20 | 73 74 65 70 73 20 61 72 |mediate |steps ar|
|00001160| 65 20 63 6f 6d 70 6c 65 | 74 65 6c 79 20 68 69 64 |e comple|tely hid|
|00001170| 64 65 6e 2e 20 20 54 68 | 65 0d 75 73 65 72 20 6a |den. Th|e.user j|
|00001180| 75 73 74 20 73 65 65 73 | 20 74 68 65 20 6f 62 6a |ust sees| the obj|
|00001190| 65 63 74 20 62 65 69 6e | 67 20 64 72 61 67 67 65 |ect bein|g dragge|
|000011a0| 64 20 64 72 61 77 6e 20 | 69 6e 74 6f 20 69 74 73 |d drawn |into its|
|000011b0| 20 6e 65 77 20 6c 6f 63 | 61 74 69 6f 6e 2e 0d 0d | new loc|ation...|
|000011c0| 54 6f 20 6d 61 6b 65 20 | 74 68 65 20 64 72 61 67 |To make |the drag|
|000011d0| 67 65 64 20 6f 62 6a 65 | 63 74 20 73 65 65 6d 20 |ged obje|ct seem |
|000011e0| 74 6f 20 6d 6f 76 65 2c | 20 69 74 20 69 73 20 61 |to move,| it is a|
|000011f0| 6c 73 6f 20 69 6d 70 6f | 72 74 61 6e 74 20 74 6f |lso impo|rtant to|
|00001200| 20 65 72 61 73 65 20 69 | 74 20 66 72 6f 6d 20 69 | erase i|t from i|
|00001210| 74 73 0d 6f 6c 64 20 6c | 6f 63 61 74 69 6f 6e 2e |ts.old l|ocation.|
|00001220| 20 20 49 66 20 74 68 69 | 73 20 77 65 72 65 20 64 | If thi|s were d|
|00001230| 6f 6e 65 20 69 6e 20 74 | 77 6f 20 73 74 65 70 73 |one in t|wo steps|
|00001240| 20 28 72 65 73 74 6f 72 | 65 20 6f 6c 64 20 6c 6f | (restor|e old lo|
|00001250| 63 61 74 69 6f 6e 2c 20 | 64 72 61 77 20 69 6e 20 |cation, |draw in |
|00001260| 6e 65 77 20 6c 6f 63 61 | 74 69 6f 6e 29 2c 0d 74 |new loca|tion),.t|
|00001270| 68 65 20 6d 6f 76 65 6d | 65 6e 74 20 77 6f 75 6c |he movem|ent woul|
|00001280| 64 20 66 6c 69 63 6b 65 | 72 2e 20 20 54 68 65 20 |d flicke|r. The |
|00001290| 75 73 65 72 20 77 6f 75 | 6c 64 20 62 65 20 61 62 |user wou|ld be ab|
|000012a0| 6c 65 20 74 6f 20 70 65 | 72 63 65 69 76 65 20 28 |le to pe|rceive (|
|000012b0| 76 65 72 79 20 65 61 73 | 69 6c 79 29 20 74 68 61 |very eas|ily) tha|
|000012c0| 74 0d 74 68 65 20 6f 62 | 6a 65 63 74 20 69 73 20 |t.the ob|ject is |
|000012d0| 66 69 72 73 74 20 72 65 | 6d 6f 76 65 64 20 66 72 |first re|moved fr|
|000012e0| 6f 6d 20 74 68 65 20 6f | 6c 64 20 6c 6f 63 61 74 |om the o|ld locat|
|000012f0| 69 6f 6e 20 61 6e 64 20 | 74 68 65 20 72 65 64 72 |ion and |the redr|
|00001300| 61 77 6e 20 69 6e 20 74 | 68 65 20 6e 65 77 20 6c |awn in t|he new l|
|00001310| 6f 63 61 74 69 6f 6e 2e | 0d 54 6f 20 70 72 65 76 |ocation.|.To prev|
|00001320| 65 6e 74 20 74 68 69 73 | 20 66 6c 69 63 6b 65 72 |ent this| flicker|
|00001330| 69 6e 67 2c 20 74 68 65 | 20 6f 6c 64 20 6c 6f 63 |ing, the| old loc|
|00001340| 61 74 69 6f 6e 20 61 6e | 64 20 74 68 65 20 6e 65 |ation an|d the ne|
|00001350| 77 20 6c 6f 63 61 74 69 | 6f 6e 20 68 61 76 65 20 |w locati|on have |
|00001360| 74 6f 20 62 65 20 75 70 | 64 61 74 65 64 0d 69 6e |to be up|dated.in|
|00001370| 20 61 20 73 69 6e 67 6c | 65 20 73 74 65 70 2e 20 | a singl|e step. |
|00001380| 20 57 6f 72 6b 69 6e 67 | 20 6f 66 66 73 63 72 65 | Working| offscre|
|00001390| 65 6e 20 61 6c 6c 6f 77 | 73 20 74 68 69 73 2e 20 |en allow|s this. |
|000013a0| 20 54 68 65 20 6d 69 64 | 64 6c 65 20 6c 61 79 65 | The mid|dle laye|
|000013b0| 72 20 69 73 20 66 69 72 | 73 74 20 75 70 64 61 74 |r is fir|st updat|
|000013c0| 65 64 20 73 6f 0d 74 68 | 61 74 20 74 68 65 20 6f |ed so.th|at the o|
|000013d0| 6c 64 20 6c 6f 63 61 74 | 69 6f 6e 20 6f 66 20 74 |ld locat|ion of t|
|000013e0| 68 65 20 6f 62 6a 65 63 | 74 20 69 73 20 72 65 73 |he objec|t is res|
|000013f0| 74 6f 72 65 64 20 74 6f | 20 62 61 63 6b 67 72 6f |tored to| backgro|
|00001400| 75 6e 64 2e 20 20 54 68 | 65 20 6d 69 64 64 6c 65 |und. Th|e middle|
|00001410| 20 6c 61 79 65 72 20 74 | 68 65 6e 20 68 61 73 0d | layer t|hen has.|
|00001420| 74 68 65 20 6f 62 6a 65 | 63 74 20 64 72 61 77 6e |the obje|ct drawn|
|00001430| 20 69 6e 74 6f 20 74 68 | 65 20 6e 65 77 20 6c 6f | into th|e new lo|
|00001440| 63 61 74 69 6f 6e 2e 20 | 20 41 6e 64 20 74 68 65 |cation. | And the|
|00001450| 6e 20 77 68 65 6e 20 74 | 68 65 20 74 72 61 6e 73 |n when t|he trans|
|00001460| 66 65 72 20 66 69 6e 61 | 6c 6c 79 20 6f 63 63 75 |fer fina|lly occu|
|00001470| 72 73 20 69 6e 74 6f 0d | 74 68 65 20 77 69 6e 64 |rs into.|the wind|
|00001480| 6f 77 20 6c 61 79 65 72 | 2c 20 61 6e 20 61 72 65 |ow layer|, an are|
|00001490| 61 20 6c 61 72 67 65 20 | 65 6e 6f 75 67 68 20 74 |a large |enough t|
|000014a0| 6f 20 63 6f 76 65 72 20 | 62 6f 74 68 20 74 68 65 |o cover |both the|
|000014b0| 20 6f 6c 64 20 6c 6f 63 | 61 74 69 6f 6e 20 61 6e | old loc|ation an|
|000014c0| 64 20 74 68 65 20 6e 65 | 77 20 6c 6f 63 61 74 69 |d the ne|w locati|
|000014d0| 6f 6e 0d 61 72 65 20 74 | 72 61 6e 73 66 65 72 72 |on.are t|ransferr|
|000014e0| 65 64 20 61 74 20 6f 6e | 63 65 20 77 69 74 68 20 |ed at on|ce with |
|000014f0| 61 20 73 69 6e 67 6c 65 | 20 43 6f 70 79 42 69 74 |a single| CopyBit|
|00001500| 73 2e 0d 0d 0d 47 57 4c | 61 79 65 72 73 2e 63 20 |s....GWL|ayers.c |
|00001510| 63 6f 6e 76 65 6e 74 69 | 6f 6e 73 3a 0d 0d 55 70 |conventi|ons:..Up|
|00001520| 64 61 74 69 6e 67 20 6f | 66 20 65 61 63 68 20 6c |dating o|f each l|
|00001530| 61 79 65 72 20 69 73 20 | 68 61 6e 64 6c 65 64 20 |ayer is |handled |
|00001540| 62 79 20 74 68 65 20 6c | 61 79 65 72 20 69 74 73 |by the l|ayer its|
|00001550| 65 6c 66 2e 20 20 41 20 | 70 61 72 74 69 63 75 6c |elf. A |particul|
|00001560| 61 72 20 6c 61 79 65 72 | 20 63 68 65 63 6b 73 20 |ar layer| checks |
|00001570| 74 6f 0d 73 65 65 20 69 | 66 20 74 68 65 72 65 20 |to.see i|f there |
|00001580| 69 73 20 61 20 6c 61 79 | 65 72 20 62 65 6c 6f 77 |is a lay|er below|
|00001590| 2c 20 61 6e 64 20 69 66 | 20 74 68 65 72 65 20 69 |, and if| there i|
|000015a0| 73 2c 20 64 6f 65 73 20 | 61 20 43 6f 70 79 42 69 |s, does |a CopyBi|
|000015b0| 74 73 20 6f 66 20 74 68 | 65 20 72 65 6c 65 76 61 |ts of th|e releva|
|000015c0| 6e 74 20 61 72 65 61 0d | 66 72 6f 6d 20 74 68 65 |nt area.|from the|
|000015d0| 20 62 65 6c 6f 77 20 6c | 61 79 65 72 20 69 6e 74 | below l|ayer int|
|000015e0| 6f 20 69 74 73 65 6c 66 | 2e 20 20 49 66 20 61 66 |o itself|. If af|
|000015f0| 74 65 72 20 74 68 65 20 | 43 6f 70 79 42 69 74 73 |ter the |CopyBits|
|00001600| 20 74 68 65 72 65 20 69 | 73 20 61 6e 79 20 61 64 | there i|s any ad|
|00001610| 64 69 74 69 6f 6e 61 6c | 0d 64 72 61 77 69 6e 67 |ditional|.drawing|
|00001620| 20 6e 65 65 64 65 64 20 | 28 73 75 63 68 20 61 73 | needed |(such as|
|00001630| 20 74 68 65 20 6d 69 64 | 64 6c 65 20 6c 61 79 65 | the mid|dle laye|
|00001640| 72 20 69 6e 20 74 68 65 | 20 61 62 6f 76 65 20 65 |r in the| above e|
|00001650| 78 61 6d 70 6c 65 29 2c | 20 74 68 65 6e 20 69 74 |xample),| then it|
|00001660| 20 69 73 20 74 79 70 69 | 63 61 6c 6c 79 0d 64 6f | is typi|cally.do|
|00001670| 6e 65 20 61 66 74 65 72 | 20 74 68 65 20 43 6f 70 |ne after| the Cop|
|00001680| 79 42 69 74 73 2e 0d 0d | 53 69 6e 63 65 20 74 68 |yBits...|Since th|
|00001690| 65 20 6c 61 79 65 72 73 | 20 61 63 74 75 61 6c 6c |e layers| actuall|
|000016a0| 79 20 6e 65 65 64 20 74 | 6f 20 75 70 64 61 74 65 |y need t|o update|
|000016b0| 20 66 72 6f 6d 20 74 68 | 65 20 62 6f 74 74 6f 6d | from th|e bottom|
|000016c0| 2d 6d 6f 73 74 20 6c 61 | 79 65 72 20 74 6f 20 74 |-most la|yer to t|
|000016d0| 68 65 20 74 6f 70 2d 6d | 6f 73 74 0d 6c 61 79 65 |he top-m|ost.laye|
|000016e0| 72 20 28 74 6f 70 2d 6d | 6f 73 74 20 62 65 69 6e |r (top-m|ost bein|
|000016f0| 67 20 74 68 65 20 77 69 | 6e 64 6f 77 2c 20 73 68 |g the wi|ndow, sh|
|00001700| 6f 77 69 6e 67 20 74 68 | 65 20 66 69 6e 61 6c 20 |owing th|e final |
|00001710| 72 65 73 75 6c 74 29 2c | 20 74 68 65 20 6c 61 79 |result),| the lay|
|00001720| 65 72 20 75 70 64 61 74 | 69 6e 67 20 63 6f 64 65 |er updat|ing code|
|00001730| 0d 63 68 65 63 6b 73 20 | 74 6f 20 73 65 65 20 69 |.checks |to see i|
|00001740| 66 20 74 68 65 72 65 20 | 69 73 20 61 20 6c 61 79 |f there |is a lay|
|00001750| 65 72 20 62 65 6c 6f 77 | 2e 20 20 49 66 20 74 68 |er below|. If th|
|00001760| 65 72 65 20 69 73 2c 20 | 74 68 65 6e 20 74 68 65 |ere is, |then the|
|00001770| 20 75 70 64 61 74 65 20 | 70 72 6f 63 65 64 75 72 | update |procedur|
|00001780| 65 20 69 73 0d 63 61 6c | 6c 65 64 20 66 6f 72 20 |e is.cal|led for |
|00001790| 74 68 65 20 6c 61 79 65 | 72 20 62 65 6c 6f 77 2e |the laye|r below.|
|000017a0| 20 20 54 68 69 73 20 72 | 65 63 75 72 73 69 6f 6e | This r|ecursion|
|000017b0| 20 63 6f 6e 74 69 6e 75 | 65 73 20 75 6e 74 69 6c | continu|es until|
|000017c0| 20 74 68 65 20 62 6f 74 | 74 6f 6d 2d 6d 6f 73 74 | the bot|tom-most|
|000017d0| 20 6c 61 79 65 72 20 69 | 73 0d 72 65 61 63 68 65 | layer i|s.reache|
|000017e0| 64 2e 20 20 54 68 65 20 | 62 6f 74 74 6f 6d 2d 6d |d. The |bottom-m|
|000017f0| 6f 73 74 20 6c 61 79 65 | 72 20 74 68 65 6e 20 64 |ost laye|r then d|
|00001800| 6f 65 73 20 69 74 73 20 | 74 68 69 6e 67 2e 20 20 |oes its |thing. |
|00001810| 28 46 6f 72 20 74 68 65 | 20 63 61 73 65 20 77 68 |(For the| case wh|
|00001820| 65 72 65 20 74 68 65 20 | 62 6f 74 74 6f 6d 2d 6d |ere the |bottom-m|
|00001830| 6f 73 74 0d 6c 61 79 65 | 72 20 69 73 20 62 61 63 |ost.laye|r is bac|
|00001840| 6b 67 72 6f 75 6e 64 20 | 74 68 69 73 20 22 74 68 |kground |this "th|
|00001850| 69 6e 67 22 20 77 69 6c | 6c 20 62 65 20 74 6f 20 |ing" wil|l be to |
|00001860| 64 6f 20 6e 6f 74 68 69 | 6e 67 2e 29 20 20 4f 6e |do nothi|ng.) On|
|00001870| 63 65 20 74 68 65 20 75 | 70 64 61 74 65 20 66 6f |ce the u|pdate fo|
|00001880| 72 20 74 68 65 20 6c 61 | 79 65 72 0d 69 73 20 63 |r the la|yer.is c|
|00001890| 6f 6d 70 6c 65 74 65 64 | 2c 20 74 68 65 20 75 70 |ompleted|, the up|
|000018a0| 64 61 74 65 20 70 72 6f | 63 65 64 75 72 65 20 73 |date pro|cedure s|
|000018b0| 69 6d 70 6c 79 20 72 65 | 74 75 72 6e 73 2e 20 20 |imply re|turns. |
|000018c0| 49 74 20 77 69 6c 6c 20 | 72 65 74 75 72 6e 20 74 |It will |return t|
|000018d0| 6f 20 74 68 65 20 63 61 | 6c 6c 65 72 2c 20 77 68 |o the ca|ller, wh|
|000018e0| 69 63 68 0d 69 73 20 74 | 68 65 20 6c 61 79 65 72 |ich.is t|he layer|
|000018f0| 20 61 62 6f 76 65 20 69 | 74 20 28 69 66 20 61 6e | above i|t (if an|
|00001900| 79 29 2e 20 20 54 68 65 | 20 6e 65 78 74 20 6c 61 |y). The| next la|
|00001910| 79 65 72 20 75 70 20 64 | 6f 65 73 20 69 74 73 20 |yer up d|oes its |
|00001920| 74 68 69 6e 67 2c 20 61 | 6e 64 20 74 68 65 6e 20 |thing, a|nd then |
|00001930| 72 65 74 75 72 6e 73 2c | 20 61 6e 64 0d 73 6f 20 |returns,| and.so |
|00001940| 6f 6e 2e 20 20 54 68 69 | 73 20 72 65 63 75 72 73 |on. Thi|s recurs|
|00001950| 69 76 65 20 63 68 61 69 | 6e 20 6f 66 20 6c 61 79 |ive chai|n of lay|
|00001960| 65 72 73 20 61 6c 6c 6f | 77 73 20 74 68 65 20 75 |ers allo|ws the u|
|00001970| 70 64 61 74 69 6e 67 20 | 74 6f 20 68 61 70 70 65 |pdating |to happe|
|00001980| 6e 20 61 75 74 6f 6d 61 | 74 69 63 61 6c 6c 79 20 |n automa|tically |
|00001990| 69 6e 0d 74 68 65 20 6f | 72 64 65 72 20 64 65 73 |in.the o|rder des|
|000019a0| 69 67 6e 61 74 65 64 20 | 62 79 20 74 68 65 20 6c |ignated |by the l|
|000019b0| 61 79 65 72 20 68 69 65 | 72 61 72 63 68 79 2e 0d |ayer hie|rarchy..|
|000019c0| 0d 53 69 6e 63 65 20 77 | 69 6e 64 6f 77 20 72 65 |.Since w|indow re|
|000019d0| 63 6f 72 64 73 20 61 6e | 64 20 47 57 6f 72 6c 64 |cords an|d GWorld|
|000019e0| 20 72 65 63 6f 72 64 73 | 20 64 6f 6e 27 74 20 68 | records| don't h|
|000019f0| 61 76 65 20 61 6e 79 20 | 66 69 65 6c 64 73 20 66 |ave any |fields f|
|00001a00| 6f 72 20 61 6c 6c 20 6f | 66 20 74 68 65 20 73 74 |or all o|f the st|
|00001a10| 75 66 66 20 77 65 0d 6e | 65 65 64 20 74 6f 20 6b |uff we.n|eed to k|
|00001a20| 65 65 70 20 28 73 75 63 | 68 20 61 73 20 61 62 6f |eep (suc|h as abo|
|00001a30| 76 65 2d 6c 61 79 65 72 | 2c 20 62 65 6c 6f 77 2d |ve-layer|, below-|
|00001a40| 6c 61 79 65 72 2c 20 75 | 70 64 61 74 65 20 70 72 |layer, u|pdate pr|
|00001a50| 6f 63 65 64 75 72 65 73 | 2c 20 65 74 63 2e 29 2c |ocedures|, etc.),|
|00001a60| 20 74 68 69 73 0d 69 6d | 70 6c 65 6d 65 6e 74 61 | this.im|plementa|
|00001a70| 74 69 6f 6e 20 75 73 65 | 73 20 61 20 68 61 6e 64 |tion use|s a hand|
|00001a80| 6c 65 20 74 6f 20 68 6f | 6c 64 20 74 68 65 20 6c |le to ho|ld the l|
|00001a90| 61 79 65 72 20 72 65 63 | 6f 72 64 2e 20 20 45 61 |ayer rec|ord. Ea|
|00001aa0| 63 68 20 6c 61 79 65 72 | 20 72 65 63 6f 72 64 20 |ch layer| record |
|00001ab0| 68 61 73 20 61 20 72 65 | 66 65 72 65 6e 63 65 0d |has a re|ference.|
|00001ac0| 74 6f 20 74 68 65 20 77 | 69 6e 64 6f 77 20 6f 72 |to the w|indow or|
|00001ad0| 20 47 57 6f 72 6c 64 20 | 69 73 20 69 73 20 74 6f | GWorld |is is to|
|00001ae0| 20 64 72 61 77 20 69 6e | 74 6f 2c 20 70 6c 75 73 | draw in|to, plus|
|00001af0| 20 61 20 72 65 66 65 72 | 65 6e 63 65 20 74 6f 20 | a refer|ence to |
|00001b00| 77 68 61 74 20 6c 61 79 | 65 72 73 20 72 65 63 6f |what lay|ers reco|
|00001b10| 72 64 73 0d 61 72 65 20 | 61 62 6f 76 65 20 61 6e |rds.are |above an|
|00001b20| 64 20 62 65 6c 6f 77 2c | 20 69 66 20 61 6e 79 2e |d below,| if any.|
|00001b30| 20 20 54 68 65 20 73 74 | 72 75 63 74 75 72 65 20 | The st|ructure |
|00001b40| 66 6f 72 20 61 20 6c 61 | 79 65 72 20 72 65 63 6f |for a la|yer reco|
|00001b50| 72 64 20 69 73 20 61 73 | 20 66 6f 6c 6c 6f 77 73 |rd is as| follows|
|00001b60| 3a 0d 0d 74 79 70 65 64 | 65 66 20 73 74 72 75 63 |:..typed|ef struc|
|00001b70| 74 20 4c 61 79 65 72 52 | 65 63 20 7b 0d 20 20 20 |t LayerR|ec {. |
|00001b80| 20 4c 61 79 65 72 4f 62 | 6a 20 20 20 20 20 20 20 | LayerOb|j |
|00001b90| 20 61 62 6f 76 65 4c 61 | 79 65 72 3b 20 20 20 20 | aboveLa|yer; |
|00001ba0| 20 20 20 20 20 4e 69 6c | 20 69 66 20 6e 6f 20 61 | Nil| if no a|
|00001bb0| 62 6f 76 65 20 6c 61 79 | 65 72 2e 0d 20 20 20 20 |bove lay|er.. |
|00001bc0| 4c 61 79 65 72 4f 62 6a | 20 20 20 20 20 20 20 20 |LayerObj| |
|00001bd0| 62 65 6c 6f 77 4c 61 79 | 65 72 3b 20 20 20 20 20 |belowLay|er; |
|00001be0| 20 20 20 20 4e 69 6c 20 | 69 66 20 6e 6f 20 62 65 | Nil |if no be|
|00001bf0| 6c 6f 77 20 6c 61 79 65 | 72 2e 0d 20 20 20 20 42 |low laye|r.. B|
|00001c00| 6f 6f 6c 65 61 6e 20 20 | 20 20 20 20 20 20 20 6c |oolean | l|
|00001c10| 61 79 65 72 4f 77 6e 73 | 50 6f 72 74 3b 20 20 20 |ayerOwns|Port; |
|00001c20| 20 20 20 54 72 75 65 20 | 69 66 20 6c 61 79 65 72 | True |if layer|
|00001c30| 20 63 72 65 61 74 65 64 | 20 74 68 65 20 47 57 6f | created| the GWo|
|00001c40| 72 6c 64 2e 0d 20 20 20 | 20 47 72 61 66 50 74 72 |rld.. | GrafPtr|
|00001c50| 20 20 20 20 20 20 20 20 | 20 6c 61 79 65 72 50 6f | | layerPo|
|00001c60| 72 74 3b 20 20 20 20 20 | 20 20 20 20 20 57 69 6e |rt; | Win|
|00001c70| 64 6f 77 20 6f 72 20 47 | 57 6f 72 6c 64 20 74 68 |dow or G|World th|
|00001c80| 69 73 20 6c 61 79 65 72 | 20 64 72 61 77 73 20 69 |is layer| draws i|
|00001c90| 6e 74 6f 2e 0d 20 20 20 | 20 47 44 48 61 6e 64 6c |nto.. | GDHandl|
|00001ca0| 65 20 20 20 20 20 20 20 | 20 6c 61 79 65 72 47 44 |e | layerGD|
|00001cb0| 65 76 69 63 65 3b 20 20 | 20 20 20 20 20 54 68 65 |evice; | The|
|00001cc0| 20 47 44 65 76 69 63 65 | 20 66 6f 72 20 74 68 69 | GDevice| for thi|
|00001cd0| 73 20 6c 61 79 65 72 2e | 0d 20 20 20 20 48 61 6e |s layer.|. Han|
|00001ce0| 64 6c 65 20 20 20 20 20 | 20 20 20 20 20 6c 61 79 |dle | lay|
|00001cf0| 65 72 42 69 74 6d 61 70 | 3b 20 20 20 20 20 20 20 |erBitmap|; |
|00001d00| 20 49 66 20 47 57 6f 72 | 6c 64 73 20 61 72 65 6e | If GWor|lds aren|
|00001d10| 27 74 20 61 76 61 69 6c | 61 62 6c 65 2c 20 74 68 |'t avail|able, th|
|00001d20| 69 73 20 68 6f 6c 64 73 | 20 74 68 65 20 62 69 74 |is holds| the bit|
|00001d30| 6d 61 70 2e 0d 20 20 20 | 20 73 68 6f 72 74 20 20 |map.. | short |
|00001d40| 20 20 20 20 20 20 20 20 | 20 6c 61 79 65 72 44 65 | | layerDe|
|00001d50| 70 74 68 3b 20 20 20 20 | 20 20 20 20 20 52 65 71 |pth; | Req|
|00001d60| 75 65 73 74 65 64 20 4e | 65 77 4c 61 79 65 72 20 |uested N|ewLayer |
|00001d70| 64 65 70 74 68 20 6f 66 | 20 70 69 78 6d 61 70 2e |depth of| pixmap.|
|00001d80| 0d 20 20 20 20 4c 61 79 | 65 72 50 72 6f 63 20 20 |. Lay|erProc |
|00001d90| 20 20 20 20 20 6c 61 79 | 65 72 50 72 6f 63 3b 20 | lay|erProc; |
|00001da0| 20 20 20 20 20 20 20 20 | 20 4c 61 79 65 72 20 70 | | Layer p|
|00001db0| 72 6f 63 65 64 75 72 65 | 2e 20 20 49 66 20 6e 69 |rocedure|. If ni|
|00001dc0| 6c 2c 20 74 68 65 6e 20 | 64 65 66 61 75 6c 74 20 |l, then |default |
|00001dd0| 62 65 68 61 76 69 6f 72 | 73 20 75 73 65 64 2e 0d |behavior|s used..|
|00001de0| 20 20 20 20 75 6e 73 69 | 67 6e 65 64 20 6c 6f 6e | unsi|gned lon|
|00001df0| 67 20 20 20 6c 61 79 65 | 72 44 61 74 61 3b 20 20 |g laye|rData; |
|00001e00| 20 20 20 20 20 20 20 20 | 41 70 70 6c 69 63 61 74 | |Applicat|
|00001e10| 69 6f 6e 20 72 65 66 43 | 6f 6e 2d 74 79 70 65 20 |ion refC|on-type |
|00001e20| 66 69 65 6c 64 2e 0d 20 | 20 20 20 73 68 6f 72 74 |field.. | short|
|00001e30| 20 20 20 20 20 20 20 20 | 20 20 20 78 66 65 72 4d | | xferM|
|00001e40| 6f 64 65 3b 20 20 20 20 | 20 20 20 20 20 20 20 54 |ode; | T|
|00001e50| 72 61 6e 73 66 65 72 20 | 6d 6f 64 65 20 66 6f 72 |ransfer |mode for|
|00001e60| 20 43 6f 70 79 42 69 74 | 73 2e 0d 20 20 20 20 52 | CopyBit|s.. R|
|00001e70| 65 63 74 20 20 20 20 20 | 20 20 20 20 20 20 20 73 |ect | s|
|00001e80| 72 63 52 65 63 74 3b 20 | 20 20 20 20 20 20 20 20 |rcRect; | |
|00001e90| 20 20 20 49 6e 69 74 69 | 61 6c 6c 79 20 6e 69 6c | Initi|ally nil|
|00001ea0| 2c 20 77 68 69 63 68 20 | 6d 61 6b 65 73 20 65 6e |, which |makes en|
|00001eb0| 74 69 72 65 20 47 57 6f | 72 6c 64 20 73 6f 75 72 |tire GWo|rld sour|
|00001ec0| 63 65 2e 0d 20 20 20 20 | 52 65 63 74 20 20 20 20 |ce.. |Rect |
|00001ed0| 20 20 20 20 20 20 20 20 | 64 73 74 52 65 63 74 3b | |dstRect;|
|00001ee0| 20 20 20 20 20 20 20 20 | 20 20 20 20 49 6e 69 74 | | Init|
|00001ef0| 69 61 6c 6c 79 20 6e 69 | 6c 2c 20 77 68 69 63 68 |ially ni|l, which|
|00001f00| 20 6d 61 6b 65 73 20 65 | 6e 74 69 72 65 20 77 69 | makes e|ntire wi|
|00001f10| 6e 64 6f 77 2f 47 57 6f | 72 6c 64 20 64 65 73 74 |ndow/GWo|rld dest|
|00001f20| 2e 0d 20 20 20 20 52 65 | 63 74 20 20 20 20 20 20 |.. Re|ct |
|00001f30| 20 20 20 20 20 20 74 68 | 69 73 55 70 64 61 74 65 | th|isUpdate|
|00001f40| 3b 20 20 20 20 20 20 20 | 20 20 41 72 65 61 20 74 |; | Area t|
|00001f50| 6f 20 62 65 20 75 70 64 | 61 74 65 64 20 66 6f 72 |o be upd|ated for|
|00001f60| 20 74 68 69 73 20 75 70 | 64 61 74 65 2e 0d 20 20 | this up|date.. |
|00001f70| 20 20 52 65 63 74 20 20 | 20 20 20 20 20 20 20 20 | Rect | |
|00001f80| 20 20 6c 61 73 74 55 70 | 64 61 74 65 3b 20 20 20 | lastUp|date; |
|00001f90| 20 20 20 20 20 20 41 72 | 65 61 20 75 70 64 61 74 | Ar|ea updat|
|00001fa0| 65 64 20 6c 61 73 74 20 | 74 69 6d 65 20 55 70 64 |ed last |time Upd|
|00001fb0| 61 74 65 4c 61 79 65 72 | 20 77 61 73 20 63 61 6c |ateLayer| was cal|
|00001fc0| 6c 65 64 2e 0d 20 20 20 | 20 42 6f 6f 6c 65 61 6e |led.. | Boolean|
|00001fd0| 20 20 20 20 20 20 20 20 | 20 69 6e 63 6c 75 64 65 | | include|
|00001fe0| 4c 61 73 74 55 70 64 61 | 74 65 3b 20 20 54 72 75 |LastUpda|te; Tru|
|00001ff0| 65 20 69 73 20 6c 61 73 | 74 20 75 70 64 61 74 65 |e is las|t update|
|00002000| 64 20 61 72 65 61 20 69 | 73 20 6f 20 75 70 64 61 |d area i|s o upda|
|00002010| 74 65 64 20 61 73 20 77 | 65 6c 6c 2e 0d 20 20 20 |ted as w|ell.. |
|00002020| 20 42 6f 6f 6c 65 61 6e | 20 20 20 20 20 20 20 20 | Boolean| |
|00002030| 20 6c 6f 63 6b 65 64 43 | 6f 75 6e 74 3b 20 20 20 | lockedC|ount; |
|00002040| 20 20 20 20 20 55 73 65 | 64 20 69 6e 74 65 72 6e | Use|d intern|
|00002050| 61 6c 6c 79 20 62 79 20 | 47 57 6f 72 6c 64 20 6c |ally by |GWorld l|
|00002060| 6f 63 6b 69 6e 67 2f 75 | 6e 6c 6f 63 6b 69 6e 67 |ocking/u|nlocking|
|00002070| 20 63 61 6c 6c 73 2e 0d | 20 20 20 20 42 6f 6f 6c | calls..| Bool|
|00002080| 65 61 6e 20 20 20 20 20 | 20 20 20 20 63 61 63 68 |ean | cach|
|00002090| 65 64 43 6f 75 6e 74 3b | 20 20 20 20 20 20 20 20 |edCount;| |
|000020a0| 55 73 65 64 20 69 6e 74 | 65 72 6e 61 6c 6c 79 20 |Used int|ernally |
|000020b0| 62 79 20 47 57 6f 72 6c | 64 20 6c 6f 63 6b 69 6e |by GWorl|d lockin|
|000020c0| 67 2f 75 6e 6c 6f 63 6b | 69 6e 67 20 63 61 6c 6c |g/unlock|ing call|
|000020d0| 73 2e 0d 20 20 20 20 43 | 47 72 61 66 50 74 72 20 |s.. C|GrafPtr |
|000020e0| 20 20 20 20 20 20 20 63 | 61 63 68 65 64 50 6f 72 | c|achedPor|
|000020f0| 74 3b 20 20 20 20 20 20 | 20 20 20 55 73 65 64 20 |t; | Used |
|00002100| 69 6e 74 65 72 6e 61 6c | 6c 79 20 62 79 20 47 57 |internal|ly by GW|
|00002110| 6f 72 6c 64 20 75 73 61 | 67 65 20 63 61 6c 6c 73 |orld usa|ge calls|
|00002120| 2e 0d 20 20 20 20 47 44 | 48 61 6e 64 6c 65 20 20 |.. GD|Handle |
|00002130| 20 20 20 20 20 20 63 61 | 63 68 65 64 47 44 65 76 | ca|chedGDev|
|00002140| 69 63 65 3b 20 20 20 20 | 20 20 55 73 65 64 20 69 |ice; | Used i|
|00002150| 6e 74 65 72 6e 61 6c 6c | 79 20 62 79 20 47 57 6f |nternall|y by GWo|
|00002160| 72 6c 64 20 75 73 61 67 | 65 20 63 61 6c 6c 73 2e |rld usag|e calls.|
|00002170| 0d 7d 20 4c 61 79 65 72 | 52 65 63 3b 0d 0d 6c 61 |.} Layer|Rec;..la|
|00002180| 79 65 72 4f 77 6e 73 50 | 6f 72 74 3a 0d 20 20 20 |yerOwnsP|ort:. |
|00002190| 20 49 66 20 74 68 65 20 | 6c 61 79 65 72 20 63 72 | If the |layer cr|
|000021a0| 65 61 74 65 64 20 74 68 | 65 20 47 57 6f 72 6c 64 |eated th|e GWorld|
|000021b0| 2c 20 74 68 65 6e 20 69 | 74 20 69 73 20 74 68 65 |, then i|t is the|
|000021c0| 20 6c 61 79 65 72 27 73 | 20 72 65 73 70 6f 6e 73 | layer's| respons|
|000021d0| 69 62 69 6c 69 74 79 20 | 74 6f 20 67 65 74 20 72 |ibility |to get r|
|000021e0| 69 64 0d 20 20 20 20 6f | 66 20 69 74 73 20 47 57 |id. o|f its GW|
|000021f0| 6f 72 6c 64 20 77 68 65 | 6e 20 74 68 65 20 6c 61 |orld whe|n the la|
|00002200| 79 65 72 20 69 73 20 64 | 69 73 70 6f 73 65 64 20 |yer is d|isposed |
|00002210| 6f 66 2e 20 20 49 66 20 | 74 68 69 73 20 66 6c 61 |of. If |this fla|
|00002220| 67 20 69 73 20 74 72 75 | 65 2c 20 74 68 65 20 47 |g is tru|e, the G|
|00002230| 57 6f 72 6c 64 0d 20 20 | 20 20 77 69 6c 6c 20 62 |World. | will b|
|00002240| 65 20 64 69 73 70 6f 73 | 65 64 20 6f 66 20 77 68 |e dispos|ed of wh|
|00002250| 65 6e 20 74 68 65 20 6c | 61 79 65 72 20 69 73 20 |en the l|ayer is |
|00002260| 64 69 73 70 6f 73 65 64 | 20 6f 66 2e 0d 0d 6c 61 |disposed| of...la|
|00002270| 79 65 72 50 72 6f 63 3a | 0d 20 20 20 20 54 68 69 |yerProc:|. Thi|
|00002280| 73 20 69 73 20 6e 69 6c | 20 69 66 20 74 68 65 20 |s is nil| if the |
|00002290| 64 65 66 61 75 6c 74 20 | 62 65 68 61 76 69 6f 72 |default |behavior|
|000022a0| 73 20 61 72 65 20 61 63 | 63 65 70 74 61 62 6c 65 |s are ac|ceptable|
|000022b0| 20 66 6f 72 20 61 20 70 | 61 72 74 69 63 75 6c 61 | for a p|articula|
|000022c0| 72 20 6c 61 79 65 72 2e | 0d 20 20 20 20 49 66 20 |r layer.|. If |
|000022d0| 74 68 69 73 20 69 73 20 | 6e 6f 6e 2d 6e 69 6c 2c |this is |non-nil,|
|000022e0| 20 74 68 65 6e 20 79 6f | 75 20 61 72 65 20 72 65 | then yo|u are re|
|000022f0| 73 70 6f 6e 73 69 62 6c | 65 20 66 6f 72 20 69 6d |sponsibl|e for im|
|00002300| 70 6c 65 6d 65 6e 74 69 | 6e 67 20 65 61 63 68 20 |plementi|ng each |
|00002310| 6c 61 79 65 72 0d 20 20 | 20 20 6d 65 73 73 61 67 |layer. | messag|
|00002320| 65 20 62 65 68 61 76 69 | 6f 72 2e 20 20 28 4d 6f |e behavi|or. (Mo|
|00002330| 72 65 20 6f 6e 20 74 68 | 69 73 20 6c 61 74 65 72 |re on th|is later|
|00002340| 2e 29 0d 0d 78 66 65 72 | 4d 6f 64 65 3a 0d 20 20 |.)..xfer|Mode:. |
|00002350| 20 20 54 68 69 73 20 69 | 73 20 74 68 65 20 74 72 | This i|s the tr|
|00002360| 61 6e 73 66 65 72 20 6d | 6f 64 65 20 66 6f 72 20 |ansfer m|ode for |
|00002370| 43 6f 70 79 42 69 74 73 | 2e 20 20 54 68 65 20 64 |CopyBits|. The d|
|00002380| 65 66 61 75 6c 74 20 62 | 65 68 61 76 69 6f 72 20 |efault b|ehavior |
|00002390| 66 6f 72 20 75 70 64 61 | 74 69 6e 67 20 73 69 6d |for upda|ting sim|
|000023a0| 70 6c 79 0d 20 20 20 20 | 74 72 61 6e 73 66 65 72 |ply. |transfer|
|000023b0| 73 20 73 6f 6d 65 20 6f | 72 20 61 6c 6c 20 6f 66 |s some o|r all of|
|000023c0| 20 74 68 65 20 62 65 6c | 6f 77 20 6c 61 79 65 72 | the bel|ow layer|
|000023d0| 20 28 69 66 20 74 68 65 | 72 65 20 69 73 20 6f 6e | (if the|re is on|
|000023e0| 65 29 20 69 6e 74 6f 20 | 74 68 65 20 63 75 72 72 |e) into |the curr|
|000023f0| 65 6e 74 20 6c 61 79 65 | 72 2e 0d 20 20 20 20 49 |ent laye|r.. I|
|00002400| 74 20 64 6f 65 73 20 74 | 68 69 73 20 77 69 74 68 |t does t|his with|
|00002410| 20 43 6f 70 79 42 69 74 | 73 2c 20 75 73 69 6e 67 | CopyBit|s, using|
|00002420| 20 74 68 65 20 64 65 73 | 69 67 6e 61 74 65 64 20 | the des|ignated |
|00002430| 74 72 61 6e 73 66 65 72 | 20 6d 6f 64 65 2e 0d 0d |transfer| mode...|
|00002440| 73 72 63 52 65 63 74 3a | 0d 20 20 20 20 54 68 69 |srcRect:|. Thi|
|00002450| 73 20 69 73 20 69 6e 69 | 74 69 61 6c 6c 79 20 61 |s is ini|tially a|
|00002460| 6e 20 65 6d 70 74 79 20 | 72 65 63 74 2e 20 20 49 |n empty |rect. I|
|00002470| 66 20 74 68 69 73 20 73 | 72 63 52 65 63 74 20 69 |f this s|rcRect i|
|00002480| 73 20 65 6d 70 74 79 2c | 20 74 68 65 6e 20 74 68 |s empty,| then th|
|00002490| 65 20 70 6f 72 74 52 65 | 63 74 20 6f 66 20 74 68 |e portRe|ct of th|
|000024a0| 65 0d 20 20 20 20 47 57 | 6f 72 6c 64 20 69 73 20 |e. GW|orld is |
|000024b0| 75 73 65 64 20 61 73 20 | 74 68 65 20 73 72 63 52 |used as |the srcR|
|000024c0| 65 63 74 2e 20 20 54 68 | 69 73 20 6d 65 61 6e 73 |ect. Th|is means|
|000024d0| 20 74 68 65 20 64 65 66 | 61 75 6c 74 20 73 72 63 | the def|ault src|
|000024e0| 52 65 63 74 20 69 73 20 | 74 68 65 20 65 6e 74 69 |Rect is |the enti|
|000024f0| 72 65 20 47 57 6f 72 6c | 64 2e 0d 20 20 20 20 49 |re GWorl|d.. I|
|00002500| 66 20 74 68 69 73 20 66 | 69 65 6c 64 20 69 73 20 |f this f|ield is |
|00002510| 73 65 74 20 74 6f 20 61 | 20 6e 6f 6e 2d 65 6d 70 |set to a| non-emp|
|00002520| 74 79 20 72 65 63 74 2c | 20 74 68 65 20 64 65 66 |ty rect,| the def|
|00002530| 61 75 6c 74 20 75 70 64 | 61 74 65 20 62 65 68 61 |ault upd|ate beha|
|00002540| 76 69 6f 72 20 69 73 20 | 74 6f 20 64 6f 20 61 20 |vior is |to do a |
|00002550| 43 6f 70 79 42 69 74 73 | 0d 20 20 20 20 6f 66 20 |CopyBits|. of |
|00002560| 6a 75 73 74 20 74 68 65 | 20 73 72 63 52 65 63 74 |just the| srcRect|
|00002570| 20 61 72 65 61 2c 20 61 | 6e 64 20 6e 6f 74 20 74 | area, a|nd not t|
|00002580| 68 65 20 65 6e 74 69 72 | 65 20 47 57 6f 72 6c 64 |he entir|e GWorld|
|00002590| 2e 20 20 28 52 65 6d 65 | 6d 62 65 72 2c 20 74 68 |. (Reme|mber, th|
|000025a0| 65 20 43 6f 70 79 42 69 | 74 73 20 69 73 20 64 6f |e CopyBi|ts is do|
|000025b0| 6e 65 20 62 79 0d 20 20 | 20 20 74 68 65 20 61 62 |ne by. | the ab|
|000025c0| 6f 76 65 20 6c 61 79 65 | 72 2c 20 73 6f 20 6f 6e |ove laye|r, so on|
|000025d0| 6c 79 20 69 66 20 74 68 | 65 20 61 62 6f 76 65 20 |ly if th|e above |
|000025e0| 6c 61 79 65 72 20 75 73 | 65 73 20 74 68 65 20 64 |layer us|es the d|
|000025f0| 65 66 61 75 6c 74 20 75 | 70 64 61 74 65 20 62 65 |efault u|pdate be|
|00002600| 68 61 76 69 6f 72 20 64 | 6f 65 73 20 74 68 69 73 |havior d|oes this|
|00002610| 0d 20 20 20 20 6f 63 63 | 75 72 20 61 75 74 6f 6d |. occ|ur autom|
|00002620| 61 74 69 63 61 6c 6c 79 | 2e 29 0d 20 20 20 20 48 |atically|.). H|
|00002630| 61 76 69 6e 67 20 61 20 | 73 72 63 52 65 63 74 20 |aving a |srcRect |
|00002640| 73 6d 61 6c 6c 65 72 20 | 74 68 61 6e 20 74 68 65 |smaller |than the|
|00002650| 20 65 6e 74 69 72 65 20 | 47 57 6f 72 6c 64 20 61 | entire |GWorld a|
|00002660| 6c 6c 6f 77 73 20 66 6f | 72 20 61 64 64 69 74 69 |llows fo|r additi|
|00002670| 6f 6e 61 6c 20 65 66 66 | 65 63 74 73 2c 20 73 75 |onal eff|ects, su|
|00002680| 63 68 20 61 73 0d 20 20 | 20 20 66 61 74 2d 62 69 |ch as. | fat-bi|
|00002690| 74 73 2e 20 20 49 66 20 | 74 68 65 20 73 72 63 52 |ts. If |the srcR|
|000026a0| 65 63 74 20 66 6f 72 20 | 74 68 69 73 20 6c 61 79 |ect for |this lay|
|000026b0| 65 72 20 69 73 20 73 6d | 61 6c 6c 65 72 20 74 68 |er is sm|aller th|
|000026c0| 61 6e 20 74 68 65 20 64 | 73 74 52 65 63 74 20 6f |an the d|stRect o|
|000026d0| 66 20 74 68 65 20 61 62 | 6f 76 65 20 6c 61 79 65 |f the ab|ove laye|
|000026e0| 72 2c 0d 20 20 20 20 43 | 6f 70 79 42 69 74 73 20 |r,. C|opyBits |
|000026f0| 77 69 6c 6c 20 74 72 61 | 6e 73 66 65 72 20 61 20 |will tra|nsfer a |
|00002700| 73 6d 61 6c 6c 20 72 65 | 63 74 20 69 6e 74 6f 20 |small re|ct into |
|00002710| 61 20 62 69 67 20 72 65 | 63 74 2e 20 20 54 68 65 |a big re|ct. The|
|00002720| 20 69 6d 61 67 65 20 77 | 69 6c 6c 20 62 65 20 73 | image w|ill be s|
|00002730| 63 61 6c 65 64 20 74 6f | 0d 20 20 20 20 61 63 63 |caled to|. acc|
|00002740| 6f 6d 6d 6f 64 61 74 65 | 20 74 68 65 20 6c 61 72 |ommodate| the lar|
|00002750| 67 65 72 20 64 65 73 74 | 69 6e 61 74 69 6f 6e 20 |ger dest|ination |
|00002760| 72 65 63 74 2c 20 61 6e | 64 20 70 72 65 73 74 6f |rect, an|d presto|
|00002770| 20 2d 2d 20 66 61 74 2d | 62 69 74 73 21 21 0d 0d | -- fat-|bits!!..|
|00002780| 64 73 74 52 65 63 74 3a | 0d 20 20 20 20 54 68 69 |dstRect:|. Thi|
|00002790| 73 20 66 69 65 6c 64 20 | 69 73 20 69 6e 69 74 69 |s field |is initi|
|000027a0| 61 6c 6c 79 20 61 6e 20 | 65 6d 70 74 79 20 72 65 |ally an |empty re|
|000027b0| 63 74 2c 20 6a 75 73 74 | 20 6c 69 6b 65 20 73 72 |ct, just| like sr|
|000027c0| 63 52 65 63 74 2e 20 20 | 49 66 20 64 73 74 52 65 |cRect. |If dstRe|
|000027d0| 63 74 20 69 73 20 73 65 | 74 20 74 6f 20 61 0d 20 |ct is se|t to a. |
|000027e0| 20 20 20 6e 6f 6e 2d 65 | 6d 70 74 79 20 72 65 63 | non-e|mpty rec|
|000027f0| 74 2c 20 74 68 65 6e 20 | 74 68 65 20 64 65 66 61 |t, then |the defa|
|00002800| 75 6c 74 20 75 70 64 61 | 74 65 20 62 65 68 61 76 |ult upda|te behav|
|00002810| 69 6f 72 20 77 69 6c 6c | 20 43 6f 70 79 42 69 74 |ior will| CopyBit|
|00002820| 73 20 6f 6e 6c 79 20 69 | 6e 74 6f 20 74 68 69 73 |s only i|nto this|
|00002830| 20 61 72 65 61 2e 0d 20 | 20 20 20 54 68 69 73 20 | area.. | This |
|00002840| 61 6c 6c 6f 77 73 20 74 | 61 72 67 65 74 69 6e 67 |allows t|argeting|
|00002850| 20 6f 66 20 61 20 73 70 | 65 63 69 66 69 63 20 70 | of a sp|ecific p|
|00002860| 6f 72 74 69 6f 6e 20 6f | 66 20 61 20 77 69 6e 64 |ortion o|f a wind|
|00002870| 6f 77 20 66 6f 72 20 6f | 66 66 73 63 72 65 65 6e |ow for o|ffscreen|
|00002880| 20 75 70 64 61 74 69 6e | 67 2c 20 77 68 69 6c 65 | updatin|g, while|
|00002890| 0d 20 20 20 20 74 68 65 | 20 72 65 73 74 20 6f 66 |. the| rest of|
|000028a0| 20 74 68 65 20 77 69 6e | 64 6f 77 20 63 61 6e 20 | the win|dow can |
|000028b0| 62 65 20 75 73 65 64 20 | 66 72 6f 6d 20 73 63 72 |be used |from scr|
|000028c0| 6f 6c 6c 62 61 72 73 2c | 20 6f 72 20 73 6f 6d 65 |ollbars,| or some|
|000028d0| 20 73 75 63 68 20 6f 74 | 68 65 72 20 74 68 69 6e | such ot|her thin|
|000028e0| 67 2e 0d 0d 74 68 69 73 | 52 65 63 74 3a 0d 20 20 |g...this|Rect:. |
|000028f0| 20 20 54 68 69 73 20 66 | 69 65 6c 64 20 69 73 20 | This f|ield is |
|00002900| 61 6c 73 6f 20 69 6e 69 | 74 69 61 6c 6c 79 20 61 |also ini|tially a|
|00002910| 6e 20 65 6d 70 74 79 20 | 72 65 63 74 2e 20 20 54 |n empty |rect. T|
|00002920| 68 69 73 20 66 69 65 6c | 64 20 62 65 63 6f 6d 65 |his fiel|d become|
|00002930| 73 20 6e 6f 6e 2d 65 6d | 70 74 79 20 62 79 0d 20 |s non-em|pty by. |
|00002940| 20 20 20 63 61 6c 6c 69 | 6e 67 20 49 6e 76 61 6c | calli|ng Inval|
|00002950| 4c 61 79 65 72 2e 20 20 | 49 6e 76 61 6c 4c 61 79 |Layer. |InvalLay|
|00002960| 65 72 20 75 6e 69 6f 6e | 73 20 74 68 65 20 72 65 |er union|s the re|
|00002970| 63 74 20 70 61 73 73 65 | 64 20 74 6f 20 69 74 20 |ct passe|d to it |
|00002980| 69 6e 74 6f 20 74 68 69 | 73 52 65 63 74 20 61 6e |into thi|sRect an|
|00002990| 64 0d 20 20 20 20 73 74 | 6f 72 65 73 20 74 68 65 |d. st|ores the|
|000029a0| 20 72 65 73 75 6c 74 20 | 69 6e 20 74 68 69 73 52 | result |in thisR|
|000029b0| 65 63 74 2e 20 20 49 74 | 20 74 68 65 6e 20 63 61 |ect. It| then ca|
|000029c0| 6c 6c 73 20 69 74 73 65 | 6c 66 20 69 66 20 74 68 |lls itse|lf if th|
|000029d0| 65 72 65 20 69 73 20 61 | 20 62 65 6c 6f 77 20 6c |ere is a| below l|
|000029e0| 61 79 65 72 2c 20 74 68 | 75 73 0d 20 20 20 20 72 |ayer, th|us. r|
|000029f0| 65 63 75 72 73 69 76 65 | 6c 79 20 63 68 61 6e 67 |ecursive|ly chang|
|00002a00| 69 6e 67 20 74 68 69 73 | 52 65 63 74 20 66 6f 72 |ing this|Rect for|
|00002a10| 20 61 6c 6c 20 6c 61 79 | 65 72 73 20 62 65 6c 6f | all lay|ers belo|
|00002a20| 77 20 69 74 20 69 6e 20 | 74 68 65 20 6c 61 79 65 |w it in |the laye|
|00002a30| 72 20 68 69 65 72 61 72 | 63 68 79 2e 0d 0d 6c 61 |r hierar|chy...la|
|00002a40| 73 74 52 65 63 74 3a 0d | 20 20 20 20 54 68 69 73 |stRect:.| This|
|00002a50| 20 66 69 65 6c 64 20 69 | 73 20 61 6c 73 6f 20 69 | field i|s also i|
|00002a60| 6e 69 74 69 61 6c 6c 79 | 20 61 6e 20 65 6d 70 74 |nitially| an empt|
|00002a70| 79 20 72 65 63 74 2e 20 | 20 54 68 69 73 20 66 69 |y rect. | This fi|
|00002a80| 65 6c 64 20 62 65 63 6f | 6d 65 73 20 6e 6f 6e 2d |eld beco|mes non-|
|00002a90| 65 6d 70 74 79 20 61 66 | 74 65 72 0d 20 20 20 20 |empty af|ter. |
|00002aa0| 74 68 69 73 52 65 63 74 | 20 69 73 20 6e 6f 6e 2d |thisRect| is non-|
|00002ab0| 65 6d 70 74 79 20 61 6e | 64 20 74 68 65 6e 20 55 |empty an|d then U|
|00002ac0| 70 64 61 74 65 4c 61 79 | 65 72 20 69 73 20 63 61 |pdateLay|er is ca|
|00002ad0| 6c 6c 65 64 2e 20 20 4f | 6e 63 65 20 74 68 65 20 |lled. O|nce the |
|00002ae0| 75 70 64 61 74 65 20 69 | 73 20 64 6f 6e 65 2c 0d |update i|s done,.|
|00002af0| 20 20 20 20 74 68 69 73 | 52 65 63 74 20 69 73 20 | this|Rect is |
|00002b00| 63 6f 70 69 65 64 20 69 | 6e 74 6f 20 6c 61 73 74 |copied i|nto last|
|00002b10| 52 65 63 74 2c 20 61 6e | 64 20 74 68 65 6e 20 74 |Rect, an|d then t|
|00002b20| 68 69 73 52 65 63 74 20 | 69 73 20 73 65 74 20 65 |hisRect |is set e|
|00002b30| 6d 70 74 79 20 6f 6e 63 | 65 20 61 67 61 69 6e 2e |mpty onc|e again.|
|00002b40| 0d 20 20 20 20 54 68 65 | 20 6c 61 73 74 52 65 63 |. The| lastRec|
|00002b50| 74 20 66 69 65 6c 64 20 | 69 73 20 75 73 65 20 74 |t field |is use t|
|00002b60| 6f 20 6f 70 74 69 6f 6e | 61 6c 6c 79 20 63 6f 6d |o option|ally com|
|00002b70| 62 69 6e 65 20 75 70 64 | 61 74 69 6e 67 20 74 68 |bine upd|ating th|
|00002b80| 65 20 6c 61 73 74 20 75 | 70 64 61 74 65 20 77 69 |e last u|pdate wi|
|00002b90| 74 68 20 74 68 65 0d 20 | 20 20 20 63 75 72 72 65 |th the. | curre|
|00002ba0| 6e 74 20 75 70 64 61 74 | 65 2e 20 20 54 68 69 73 |nt updat|e. This|
|00002bb0| 20 69 73 20 70 61 72 74 | 69 63 75 6c 61 72 6c 79 | is part|icularly|
|00002bc0| 20 75 73 65 66 75 6c 20 | 66 6f 72 20 64 72 61 67 | useful |for drag|
|00002bd0| 67 69 6e 67 20 6f 62 6a | 65 63 74 73 2c 20 61 73 |ging obj|ects, as|
|00002be0| 20 64 65 73 63 72 69 62 | 65 64 20 61 62 6f 76 65 | describ|ed above|
|00002bf0| 2e 0d 20 20 20 20 49 6e | 20 61 20 73 69 6e 67 6c |.. In| a singl|
|00002c00| 65 20 43 6f 70 79 42 69 | 74 73 2c 20 74 68 65 20 |e CopyBi|ts, the |
|00002c10| 6f 6c 64 20 6c 6f 63 61 | 74 69 6f 6e 20 61 6e 64 |old loca|tion and|
|00002c20| 20 74 68 65 20 6e 65 77 | 20 6c 6f 63 61 74 69 6f | the new| locatio|
|00002c30| 6e 20 6e 65 65 64 20 74 | 6f 20 62 65 20 64 72 61 |n need t|o be dra|
|00002c40| 77 6e 20 69 6e 20 74 68 | 65 0d 20 20 20 20 77 69 |wn in th|e. wi|
|00002c50| 6e 64 6f 77 2e 20 20 42 | 79 20 73 65 74 74 69 6e |ndow. B|y settin|
|00002c60| 67 20 69 6e 63 6c 75 64 | 65 4c 61 73 74 55 70 64 |g includ|eLastUpd|
|00002c70| 61 74 65 20 74 72 75 65 | 2c 20 74 68 69 73 20 69 |ate true|, this i|
|00002c80| 73 20 64 6f 6e 65 20 61 | 75 74 6f 6d 61 74 69 63 |s done a|utomatic|
|00002c90| 61 6c 6c 79 20 62 79 20 | 74 68 65 20 64 65 66 61 |ally by |the defa|
|00002ca0| 75 6c 74 0d 20 20 20 20 | 75 70 64 61 74 65 20 62 |ult. |update b|
|00002cb0| 65 68 61 76 69 6f 72 2e | 0d 0d 69 6e 63 6c 75 64 |ehavior.|..includ|
|00002cc0| 65 4c 61 73 74 55 70 64 | 61 74 65 3a 0d 20 20 20 |eLastUpd|ate:. |
|00002cd0| 20 41 73 20 6a 75 73 74 | 20 64 65 73 63 72 69 62 | As just| describ|
|00002ce0| 65 64 20 66 6f 72 20 74 | 68 65 20 6c 61 73 74 52 |ed for t|he lastR|
|00002cf0| 65 63 74 20 66 69 65 6c | 64 2c 20 69 66 20 74 68 |ect fiel|d, if th|
|00002d00| 69 73 20 66 69 65 6c 64 | 20 69 73 20 74 72 75 65 |is field| is true|
|00002d10| 2c 20 74 68 65 6e 20 74 | 68 65 20 64 65 66 61 75 |, then t|he defau|
|00002d20| 6c 74 0d 20 20 20 20 75 | 70 64 61 74 65 20 62 65 |lt. u|pdate be|
|00002d30| 68 61 76 69 6f 72 20 43 | 6f 70 79 42 69 74 73 20 |havior C|opyBits |
|00002d40| 69 6e 63 6c 75 64 65 73 | 20 62 6f 74 68 20 74 68 |includes| both th|
|00002d50| 65 20 6c 61 73 74 20 75 | 70 64 61 74 65 20 61 6e |e last u|pdate an|
|00002d60| 64 20 74 68 69 73 20 75 | 70 64 61 74 65 2c 20 74 |d this u|pdate, t|
|00002d70| 68 75 73 20 67 65 6e 65 | 72 61 74 69 6e 67 0d 20 |hus gene|rating. |
|00002d80| 20 20 20 73 6d 6f 6f 74 | 68 20 61 6e 69 6d 61 74 | smoot|h animat|
|00002d90| 69 6f 6e 20 65 66 66 65 | 63 74 73 2e 0d 0d 0d 41 |ion effe|cts....A|
|00002da0| 20 63 61 6c 6c 20 74 6f | 20 63 72 65 61 74 65 20 | call to| create |
|00002db0| 61 20 6c 61 79 65 72 20 | 66 6f 72 20 61 20 77 69 |a layer |for a wi|
|00002dc0| 6e 64 6f 77 20 28 74 68 | 65 20 74 6f 70 2d 6d 6f |ndow (th|e top-mo|
|00002dd0| 73 74 20 6c 61 79 65 72 | 2c 20 6d 6f 73 74 20 6c |st layer|, most l|
|00002de0| 69 6b 65 6c 79 29 20 6d | 69 67 68 74 20 6c 6f 6f |ikely) m|ight loo|
|00002df0| 6b 20 6c 69 6b 65 20 74 | 68 69 73 3a 0d 0d 20 20 |k like t|his:.. |
|00002e00| 20 20 4e 65 77 4c 61 79 | 65 72 28 26 77 69 6e 64 | NewLay|er(&wind|
|00002e10| 6f 77 4c 61 79 65 72 2c | 20 20 20 20 4c 61 79 65 |owLayer,| Laye|
|00002e20| 72 20 6f 62 6a 65 63 74 | 20 68 61 6e 64 6c 65 20 |r object| handle |
|00002e30| 69 73 20 72 65 74 75 72 | 6e 65 64 20 68 65 72 65 |is retur|ned here|
|00002e40| 2e 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |.. | |
|00002e50| 6e 69 6c 2c 20 20 20 20 | 20 20 20 20 20 20 20 20 |nil, | |
|00002e60| 54 6f 70 20 6c 61 79 65 | 72 2c 20 73 6f 20 74 68 |Top laye|r, so th|
|00002e70| 65 72 65 20 69 73 20 6e | 6f 20 61 62 6f 76 65 20 |ere is n|o above |
|00002e80| 6c 61 79 65 72 2e 0d 20 | 20 20 20 20 20 20 20 20 |layer.. | |
|00002e90| 20 20 20 20 20 6e 69 6c | 2c 20 20 20 20 20 20 20 | nil|, |
|00002ea0| 20 20 20 20 20 55 73 65 | 73 20 64 65 66 61 75 6c | Use|s defaul|
|00002eb0| 74 20 6c 61 79 65 72 20 | 70 72 6f 63 65 64 75 72 |t layer |procedur|
|00002ec0| 65 2e 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |e.. | |
|00002ed0| 20 77 69 6e 64 6f 77 2c | 20 20 20 20 20 20 20 20 | window,| |
|00002ee0| 20 57 69 6e 64 6f 77 20 | 75 73 65 64 20 62 79 20 | Window |used by |
|00002ef0| 74 68 65 20 6c 61 79 65 | 72 20 6f 62 6a 65 63 74 |the laye|r object|
|00002f00| 2e 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |.. | |
|00002f10| 30 2c 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |0, | |
|00002f20| 44 65 70 74 68 20 66 6f | 72 20 6f 66 66 73 63 72 |Depth fo|r offscr|
|00002f30| 65 65 6e 20 30 20 66 6f | 72 20 73 63 72 65 65 6e |een 0 fo|r screen|
|00002f40| 20 64 65 70 74 68 29 2e | 0d 20 20 20 20 20 20 20 | depth).|. |
|00002f50| 20 20 20 20 20 20 20 30 | 29 3b 20 20 20 20 20 20 | 0|); |
|00002f60| 20 20 20 20 20 20 20 43 | 75 73 74 6f 6d 20 6c 61 | C|ustom la|
|00002f70| 79 65 72 20 69 6e 69 74 | 20 64 61 74 61 2c 20 69 |yer init| data, i|
|00002f80| 66 20 61 6e 79 2e 0d 0d | 49 66 20 4e 65 77 4c 61 |f any...|If NewLa|
|00002f90| 79 65 72 20 73 75 63 63 | 65 65 64 73 2c 20 74 68 |yer succ|eeds, th|
|00002fa0| 65 20 6c 61 79 65 72 20 | 6f 62 6a 65 63 74 20 68 |e layer |object h|
|00002fb0| 61 6e 64 6c 65 20 69 73 | 20 72 65 74 75 72 6e 65 |andle is| returne|
|00002fc0| 64 20 69 6e 20 77 69 6e | 64 6f 77 4c 61 79 65 72 |d in win|dowLayer|
|00002fd0| 2e 20 20 49 66 20 69 74 | 20 66 61 69 6c 73 2c 0d |. If it| fails,.|
|00002fe0| 6e 69 6c 20 69 73 20 72 | 65 74 75 72 6e 65 64 20 |nil is r|eturned |
|00002ff0| 69 6e 20 77 69 6e 64 6f | 77 4c 61 79 65 72 2c 20 |in windo|wLayer, |
|00003000| 70 6c 75 73 20 61 6e 20 | 65 72 72 6f 72 20 69 73 |plus an |error is|
|00003010| 20 72 65 74 75 72 6e 65 | 64 2e 20 20 54 68 69 73 | returne|d. This|
|00003020| 20 63 61 6c 6c 20 63 61 | 6e 20 68 61 72 64 6c 79 | call ca|n hardly|
|00003030| 20 66 61 69 6c 2c 20 61 | 73 0d 74 68 65 72 65 20 | fail, a|s.there |
|00003040| 69 73 20 6e 6f 20 6f 66 | 66 73 63 72 65 65 6e 20 |is no of|fscreen |
|00003050| 47 57 6f 72 6c 64 20 63 | 72 65 61 74 65 64 2e 20 |GWorld c|reated. |
|00003060| 20 49 66 20 6f 6e 6c 79 | 20 61 20 6d 69 6e 69 6d | If only| a minim|
|00003070| 61 6c 6c 79 2d 73 69 7a | 65 64 20 68 61 6e 64 6c |ally-siz|ed handl|
|00003080| 65 20 63 61 6e 20 62 65 | 20 63 72 65 61 74 65 64 |e can be| created|
|00003090| 2c 20 69 74 0d 77 69 6c | 6c 20 73 75 63 63 65 65 |, it.wil|l succee|
|000030a0| 64 2e 0d 0d 54 6f 20 63 | 72 65 61 74 65 20 61 20 |d...To c|reate a |
|000030b0| 77 6f 72 6b 20 6c 61 79 | 65 72 20 62 65 6c 6f 77 |work lay|er below|
|000030c0| 20 74 68 69 73 20 77 69 | 6e 64 6f 77 20 6c 61 79 | this wi|ndow lay|
|000030d0| 65 72 2c 20 77 65 20 6d | 69 67 68 74 20 6d 61 6b |er, we m|ight mak|
|000030e0| 65 20 61 20 63 61 6c 6c | 20 73 75 63 68 20 61 73 |e a call| such as|
|000030f0| 3a 0d 0d 20 20 20 20 65 | 72 72 20 3d 20 4e 65 77 |:.. e|rr = New|
|00003100| 4c 61 79 65 72 28 26 77 | 6f 72 6b 4c 61 79 65 72 |Layer(&w|orkLayer|
|00003110| 2c 20 77 69 6e 64 6f 77 | 4c 61 79 65 72 2c 20 57 |, window|Layer, W|
|00003120| 6f 72 6b 4c 61 79 65 72 | 50 72 6f 63 2c 20 6e 69 |orkLayer|Proc, ni|
|00003130| 6c 2c 20 30 2c 20 28 6c | 6f 6e 67 29 26 6d 79 49 |l, 0, (l|ong)&myI|
|00003140| 6e 66 6f 29 3b 0d 20 20 | 20 20 20 20 20 20 20 20 |nfo);. | |
|00003150| 20 20 6d 79 49 6e 66 6f | 20 69 73 20 61 20 73 74 | myInfo| is a st|
|00003160| 72 75 63 74 20 74 68 61 | 74 20 68 6f 6c 64 73 20 |ruct tha|t holds |
|00003170| 69 6e 66 6f 72 6d 61 74 | 69 6f 6e 20 74 68 61 74 |informat|ion that|
|00003180| 20 57 6f 72 6b 4c 61 79 | 65 72 50 72 6f 63 0d 20 | WorkLay|erProc. |
|00003190| 20 20 20 20 20 20 20 20 | 20 20 20 6e 65 65 64 73 | | needs|
|000031a0| 20 74 6f 20 72 65 66 65 | 72 65 6e 63 65 20 66 6f | to refe|rence fo|
|000031b0| 72 20 64 72 61 77 69 6e | 67 20 74 68 65 20 6f 62 |r drawin|g the ob|
|000031c0| 6a 65 63 74 20 69 6e 20 | 74 68 65 20 6e 65 77 20 |ject in |the new |
|000031d0| 6c 6f 63 61 74 69 6f 6e | 2e 0d 0d 54 68 69 73 20 |location|...This |
|000031e0| 63 61 6c 6c 20 68 61 73 | 20 61 20 67 72 65 61 74 |call has| a great|
|000031f0| 65 72 20 63 68 61 6e 63 | 65 20 6f 66 20 66 61 69 |er chanc|e of fai|
|00003200| 6c 75 72 65 2c 20 61 73 | 20 61 6e 20 6f 66 66 73 |lure, as| an offs|
|00003210| 63 72 65 65 6e 20 47 57 | 6f 72 6c 64 20 77 61 73 |creen GW|orld was|
|00003220| 20 63 72 65 61 74 65 64 | 20 66 6f 72 20 69 74 2e | created| for it.|
|00003230| 0d 57 65 20 70 61 73 73 | 65 64 20 69 74 20 61 20 |.We pass|ed it a |
|00003240| 6e 69 6c 20 67 72 61 66 | 50 6f 72 74 2c 20 73 6f |nil graf|Port, so|
|00003250| 20 74 68 65 20 64 65 66 | 61 75 6c 74 20 69 6e 69 | the def|ault ini|
|00003260| 74 69 61 6c 69 7a 61 74 | 69 6f 6e 20 62 65 68 61 |tializat|ion beha|
|00003270| 76 69 6f 72 20 6b 6e 6f | 77 73 20 74 68 61 74 20 |vior kno|ws that |
|00003280| 69 74 20 77 69 6c 6c 0d | 68 61 76 65 20 74 6f 20 |it will.|have to |
|00003290| 63 72 65 61 74 65 20 61 | 20 47 57 6f 72 6c 64 2e |create a| GWorld.|
|000032a0| 20 20 54 68 65 20 64 65 | 66 61 75 6c 74 20 69 6e | The de|fault in|
|000032b0| 69 74 69 61 6c 69 7a 61 | 74 69 6f 6e 20 62 65 68 |itializa|tion beh|
|000032c0| 61 76 69 6f 72 20 75 73 | 65 73 20 64 73 74 52 65 |avior us|es dstRe|
|000032d0| 63 74 20 6f 66 20 74 68 | 65 20 61 62 6f 76 65 0d |ct of th|e above.|
|000032e0| 6c 61 79 65 72 20 61 73 | 20 74 68 65 20 73 69 7a |layer as| the siz|
|000032f0| 65 20 6f 66 20 74 68 65 | 20 6f 66 66 73 63 72 65 |e of the| offscre|
|00003300| 65 6e 20 47 57 6f 72 6c | 64 20 69 74 20 69 73 20 |en GWorl|d it is |
|00003310| 74 6f 20 63 72 65 61 74 | 65 2e 20 20 49 66 20 64 |to creat|e. If d|
|00003320| 73 74 52 65 63 74 20 69 | 73 20 61 6e 20 65 6d 70 |stRect i|s an emp|
|00003330| 74 79 20 72 65 63 74 2c | 0d 74 68 65 6e 20 69 74 |ty rect,|.then it|
|00003340| 20 75 73 65 73 20 74 68 | 65 20 70 6f 72 74 52 65 | uses th|e portRe|
|00003350| 63 74 20 6f 66 20 74 68 | 65 20 61 62 6f 76 65 20 |ct of th|e above |
|00003360| 6c 61 79 65 72 20 69 6e | 73 74 65 61 64 2e 20 20 |layer in|stead. |
|00003370| 53 6f 20 69 66 20 79 6f | 75 20 77 61 6e 74 65 64 |So if yo|u wanted|
|00003380| 20 74 6f 20 6d 61 70 20 | 74 68 65 20 6f 66 66 73 | to map |the offs|
|00003390| 63 72 65 65 6e 0d 6c 61 | 79 65 72 20 74 6f 20 6a |creen.la|yer to j|
|000033a0| 75 73 74 20 61 20 70 6f | 72 74 69 6f 6e 20 6f 66 |ust a po|rtion of|
|000033b0| 20 74 68 65 20 77 69 6e | 64 6f 77 2c 20 79 6f 75 | the win|dow, you|
|000033c0| 20 77 6f 75 6c 64 20 73 | 65 74 20 74 68 65 20 64 | would s|et the d|
|000033d0| 73 74 52 65 63 74 20 66 | 6f 72 20 74 68 65 20 74 |stRect f|or the t|
|000033e0| 6f 70 2d 6d 6f 73 74 20 | 6c 61 79 65 72 0d 70 72 |op-most |layer.pr|
|000033f0| 69 6f 72 20 74 6f 20 63 | 72 65 61 74 69 6e 67 20 |ior to c|reating |
|00003400| 74 68 65 20 6d 69 64 64 | 6c 65 20 6c 61 79 65 72 |the midd|le layer|
|00003410| 2e 0d 0d 49 4d 50 4f 52 | 54 41 4e 54 3a 20 20 54 |...IMPOR|TANT: T|
|00003420| 68 65 20 64 65 66 61 75 | 6c 74 20 62 65 68 61 76 |he defau|lt behav|
|00003430| 69 6f 72 20 61 75 74 6f | 6d 61 74 69 63 61 6c 6c |ior auto|maticall|
|00003440| 79 20 63 72 65 61 74 65 | 73 20 74 68 65 20 6f 66 |y create|s the of|
|00003450| 66 73 63 72 65 65 6e 20 | 47 57 6f 72 6c 64 20 74 |fscreen |GWorld t|
|00003460| 6f 20 74 68 65 20 64 65 | 73 63 72 69 62 65 64 0d |o the de|scribed.|
|00003470| 20 20 20 20 20 20 20 20 | 20 20 20 20 73 69 7a 65 | | size|
|00003480| 2e 20 20 57 65 20 68 61 | 76 65 20 70 61 73 73 65 |. We ha|ve passe|
|00003490| 64 20 4e 65 77 4c 61 79 | 65 72 20 61 20 6c 61 79 |d NewLay|er a lay|
|000034a0| 65 72 20 70 72 6f 63 65 | 64 75 72 65 2c 20 73 6f |er proce|dure, so|
|000034b0| 20 77 65 20 64 6f 6e 27 | 74 20 61 75 74 6f 6d 61 | we don'|t automa|
|000034c0| 74 69 63 61 6c 6c 79 20 | 67 65 74 0d 20 20 20 20 |tically |get. |
|000034d0| 20 20 20 20 20 20 20 20 | 74 68 65 20 64 65 66 61 | |the defa|
|000034e0| 75 6c 74 20 62 65 68 61 | 76 69 6f 72 73 20 66 6f |ult beha|viors fo|
|000034f0| 72 20 74 68 65 20 6d 69 | 64 64 6c 65 20 6c 61 79 |r the mi|ddle lay|
|00003500| 65 72 2e 20 20 54 68 69 | 73 20 6d 75 73 74 20 62 |er. Thi|s must b|
|00003510| 65 20 6b 65 70 74 20 69 | 6e 20 6d 69 6e 64 20 77 |e kept i|n mind w|
|00003520| 68 65 6e 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |hen. | |
|00003530| 77 72 69 74 69 6e 67 20 | 74 68 65 20 6c 61 79 65 |writing |the laye|
|00003540| 72 20 70 72 6f 63 65 64 | 75 72 65 20 66 6f 72 20 |r proced|ure for |
|00003550| 74 68 65 20 6d 69 64 64 | 6c 65 20 6c 61 79 65 72 |the midd|le layer|
|00003560| 2e 20 20 54 6f 20 67 65 | 74 20 74 68 65 20 64 65 |. To ge|t the de|
|00003570| 66 61 75 6c 74 20 62 65 | 68 61 76 69 6f 72 2c 0d |fault be|havior,.|
|00003580| 20 20 20 20 20 20 20 20 | 20 20 20 20 77 65 20 73 | | we s|
|00003590| 69 6d 70 6c 79 20 63 61 | 6c 6c 20 44 65 66 61 75 |imply ca|ll Defau|
|000035a0| 6c 74 4c 61 79 65 72 49 | 6e 69 74 20 77 68 65 6e |ltLayerI|nit when|
|000035b0| 20 74 68 65 20 6c 61 79 | 65 72 20 70 72 6f 63 65 | the lay|er proce|
|000035c0| 64 75 72 65 20 67 65 74 | 73 20 61 6e 20 69 6e 69 |dure get|s an ini|
|000035d0| 74 69 61 6c 69 7a 61 74 | 69 6f 6e 0d 20 20 20 20 |tializat|ion. |
|000035e0| 20 20 20 20 20 20 20 20 | 6d 65 73 73 61 67 65 2e | |message.|
|000035f0| 20 20 53 69 6e 63 65 20 | 74 68 65 20 64 65 66 61 | Since |the defa|
|00003600| 75 6c 74 20 69 6e 69 74 | 69 61 6c 69 7a 61 74 69 |ult init|ializati|
|00003610| 6f 6e 20 62 65 68 61 76 | 69 6f 72 20 69 73 20 65 |on behav|ior is e|
|00003620| 78 61 63 74 6c 79 20 77 | 68 61 74 20 77 65 20 77 |xactly w|hat we w|
|00003630| 61 6e 74 2c 20 77 65 0d | 20 20 20 20 20 20 20 20 |ant, we.| |
|00003640| 20 20 20 20 6a 75 73 74 | 20 63 61 6c 6c 20 69 74 | just| call it|
|00003650| 20 64 69 72 65 63 74 6c | 79 2e 0d 0d 54 68 65 20 | directl|y...The |
|00003660| 72 65 61 73 6f 6e 20 74 | 68 61 74 20 77 65 20 68 |reason t|hat we h|
|00003670| 61 76 65 20 61 20 6c 61 | 79 65 72 20 70 72 6f 63 |ave a la|yer proc|
|00003680| 65 64 75 72 65 20 66 6f | 72 20 74 68 69 73 20 6c |edure fo|r this l|
|00003690| 61 79 65 72 20 69 73 20 | 74 68 61 74 20 77 65 20 |ayer is |that we |
|000036a0| 77 61 6e 74 20 74 6f 20 | 64 6f 20 73 6f 6d 65 74 |want to |do somet|
|000036b0| 68 69 6e 67 0d 64 69 66 | 66 65 72 65 6e 74 20 77 |hing.dif|ferent w|
|000036c0| 68 65 6e 20 77 65 20 72 | 65 63 65 69 76 65 20 61 |hen we r|eceive a|
|000036d0| 6e 20 75 70 64 61 74 65 | 20 6d 65 73 73 61 67 65 |n update| message|
|000036e0| 2e 20 20 46 6f 72 20 74 | 68 65 20 75 70 64 61 74 |. For t|he updat|
|000036f0| 65 20 6d 65 73 73 61 67 | 65 20 77 65 20 77 61 6e |e messag|e we wan|
|00003700| 74 20 74 6f 20 66 69 72 | 73 74 0d 74 72 61 6e 73 |t to fir|st.trans|
|00003710| 66 65 72 20 74 68 65 20 | 70 6f 72 74 69 6f 6e 20 |fer the |portion |
|00003720| 6f 66 20 62 61 63 6b 67 | 72 6f 75 6e 64 20 69 6e |of backg|round in|
|00003730| 74 6f 20 74 68 65 20 6d | 69 64 64 6c 65 20 6c 61 |to the m|iddle la|
|00003740| 79 65 72 2c 20 61 6e 64 | 20 74 68 65 6e 20 77 65 |yer, and| then we|
|00003750| 20 77 61 6e 74 20 74 6f | 20 64 72 61 77 20 74 68 | want to| draw th|
|00003760| 65 20 6f 62 6a 65 63 74 | 0d 77 65 20 61 72 65 20 |e object|.we are |
|00003770| 64 72 61 67 67 69 6e 67 | 20 69 6e 74 6f 20 74 68 |dragging| into th|
|00003780| 65 20 6d 69 64 64 6c 65 | 20 6c 61 79 65 72 2e 20 |e middle| layer. |
|00003790| 20 46 6f 72 20 74 68 65 | 20 75 70 64 61 74 65 20 | For the| update |
|000037a0| 6d 65 73 73 61 67 65 2c | 20 77 65 20 63 61 6e 20 |message,| we can |
|000037b0| 66 69 72 73 74 20 63 61 | 6c 6c 0d 44 65 66 61 75 |first ca|ll.Defau|
|000037c0| 6c 74 4c 61 79 65 72 55 | 70 64 61 74 65 20 74 6f |ltLayerU|pdate to|
|000037d0| 20 64 6f 20 74 68 65 20 | 43 6f 70 79 42 69 74 73 | do the |CopyBits|
|000037e0| 20 66 72 6f 6d 20 74 68 | 65 20 62 65 6c 6f 77 20 | from th|e below |
|000037f0| 6c 61 79 65 72 20 69 6e | 74 6f 20 74 68 65 20 6d |layer in|to the m|
|00003800| 69 64 64 6c 65 20 6c 61 | 79 65 72 2c 20 61 6e 64 |iddle la|yer, and|
|00003810| 20 74 68 65 6e 0d 72 69 | 67 68 74 20 61 66 74 65 | then.ri|ght afte|
|00003820| 72 20 74 68 61 74 20 77 | 65 20 63 61 6e 20 64 72 |r that w|e can dr|
|00003830| 61 77 20 74 68 65 20 6f | 62 6a 65 63 74 20 62 65 |aw the o|bject be|
|00003840| 69 6e 67 20 64 72 61 67 | 67 65 64 20 69 6e 74 6f |ing drag|ged into|
|00003850| 20 69 74 73 20 6e 65 77 | 20 6c 6f 63 61 74 69 6f | its new| locatio|
|00003860| 6e 2e 20 20 54 68 65 20 | 6e 65 61 74 20 74 68 69 |n. The |neat thi|
|00003870| 6e 67 0d 61 62 6f 75 74 | 20 74 68 69 73 20 69 73 |ng.about| this is|
|00003880| 20 74 68 61 74 20 74 68 | 65 20 64 65 66 61 75 6c | that th|e defaul|
|00003890| 74 20 62 65 68 61 76 69 | 6f 72 20 63 61 6e 20 73 |t behavi|or can s|
|000038a0| 74 69 6c 6c 20 63 6f 6d | 6d 6f 6e 6c 79 20 62 65 |till com|monly be|
|000038b0| 20 75 73 65 64 2c 20 65 | 76 65 6e 20 69 66 20 74 | used, e|ven if t|
|000038c0| 68 65 72 65 20 69 73 20 | 65 78 74 72 61 0d 73 74 |here is |extra.st|
|000038d0| 75 66 66 20 74 68 61 74 | 20 77 65 20 6e 65 65 64 |uff that| we need|
|000038e0| 20 74 6f 20 64 6f 2e 0d | 0d 41 73 73 75 6d 69 6e | to do..|.Assumin|
|000038f0| 67 20 6e 6f 20 65 72 72 | 6f 72 73 2c 20 77 65 20 |g no err|ors, we |
|00003900| 6e 6f 77 20 68 61 76 65 | 20 61 20 74 6f 70 2d 6d |now have| a top-m|
|00003910| 6f 73 74 20 6c 61 79 65 | 72 20 72 65 6c 61 74 69 |ost laye|r relati|
|00003920| 6e 67 20 74 6f 20 74 68 | 65 20 74 61 72 67 65 74 |ng to th|e target|
|00003930| 20 77 69 6e 64 6f 77 2c | 20 70 6c 75 73 20 61 20 | window,| plus a |
|00003940| 6d 69 64 64 6c 65 0d 6c | 61 79 65 72 20 66 6f 72 |middle.l|ayer for|
|00003950| 20 64 6f 69 6e 67 20 74 | 68 65 20 6f 66 66 73 63 | doing t|he offsc|
|00003960| 72 65 65 6e 20 64 72 61 | 77 69 6e 67 20 6f 66 20 |reen dra|wing of |
|00003970| 74 68 65 20 6f 62 6a 65 | 63 74 20 62 65 69 6e 67 |the obje|ct being|
|00003980| 20 64 72 61 67 67 65 64 | 2e 20 20 57 65 20 6e 6f | dragged|. We no|
|00003990| 77 20 6e 65 65 64 20 61 | 20 62 61 63 6b 67 72 6f |w need a| backgro|
|000039a0| 75 6e 64 0d 6c 61 79 65 | 72 20 74 68 61 74 20 68 |und.laye|r that h|
|000039b0| 61 73 20 61 6e 20 69 6d | 61 67 65 20 6f 66 20 74 |as an im|age of t|
|000039c0| 68 65 20 62 61 63 6b 67 | 72 6f 75 6e 64 20 64 72 |he backg|round dr|
|000039d0| 61 77 6e 20 69 6e 74 6f | 20 69 74 2e 20 20 54 68 |awn into| it. Th|
|000039e0| 69 73 20 63 6f 64 65 20 | 6d 69 67 68 74 20 6c 6f |is code |might lo|
|000039f0| 6f 6b 20 6c 69 6b 65 3a | 0d 0d 20 20 20 20 69 66 |ok like:|.. if|
|00003a00| 20 28 21 65 72 72 29 20 | 65 72 72 20 3d 20 4e 65 | (!err) |err = Ne|
|00003a10| 77 4c 61 79 65 72 28 26 | 62 61 63 6b 4c 61 79 65 |wLayer(&|backLaye|
|00003a20| 72 2c 20 77 6f 72 6b 4c | 61 79 65 72 2c 20 42 61 |r, workL|ayer, Ba|
|00003a30| 63 6b 4c 61 79 65 72 50 | 72 6f 63 2c 20 6e 69 6c |ckLayerP|roc, nil|
|00003a40| 2c 20 30 2c 20 28 6c 6f | 6e 67 29 26 6d 79 49 6e |, 0, (lo|ng)&myIn|
|00003a50| 66 6f 29 3b 0d 0d 54 68 | 69 73 20 6c 61 79 65 72 |fo);..Th|is layer|
|00003a60| 20 61 6c 73 6f 20 68 61 | 73 20 69 74 73 20 6f 77 | also ha|s its ow|
|00003a70| 6e 20 6c 61 79 65 72 20 | 70 72 6f 63 65 64 75 72 |n layer |procedur|
|00003a80| 65 2e 20 20 54 68 65 20 | 72 65 61 73 6f 6e 69 6e |e. The |reasonin|
|00003a90| 67 20 62 65 68 69 6e 64 | 20 74 68 69 73 20 69 73 |g behind| this is|
|00003aa0| 20 74 68 61 74 20 74 68 | 65 0d 69 6e 69 74 69 61 | that th|e.initia|
|00003ab0| 6c 69 7a 61 74 69 6f 6e | 20 77 6f 75 6c 64 20 64 |lization| would d|
|00003ac0| 6f 20 74 68 65 20 64 72 | 61 77 69 6e 67 20 69 6e |o the dr|awing in|
|00003ad0| 74 6f 20 74 68 65 20 62 | 61 63 6b 67 72 6f 75 6e |to the b|ackgroun|
|00003ae0| 64 2e 20 20 4f 6e 63 65 | 20 74 68 65 20 6c 61 79 |d. Once| the lay|
|00003af0| 65 72 73 20 61 72 65 20 | 61 6c 6c 20 73 65 74 20 |ers are |all set |
|00003b00| 75 70 2c 0d 77 65 20 77 | 61 6e 74 20 74 68 65 20 |up,.we w|ant the |
|00003b10| 62 61 63 6b 67 72 6f 75 | 6e 64 20 6c 61 79 65 72 |backgrou|nd layer|
|00003b20| 20 74 6f 20 62 65 20 66 | 75 6c 6c 79 20 69 6d 61 | to be f|ully ima|
|00003b30| 67 65 64 2e 20 20 54 68 | 69 73 20 77 61 79 20 74 |ged. Th|is way t|
|00003b40| 68 65 72 65 20 69 73 20 | 6e 6f 20 74 69 6d 65 20 |here is |no time |
|00003b50| 73 70 65 6e 74 20 66 6f | 72 20 74 68 65 0d 62 61 |spent fo|r the.ba|
|00003b60| 63 6b 67 72 6f 75 6e 64 | 20 6c 61 79 65 72 2c 20 |ckground| layer, |
|00003b70| 77 68 69 63 68 20 69 73 | 20 74 68 65 20 77 61 79 |which is| the way|
|00003b80| 20 61 20 62 61 63 6b 67 | 72 6f 75 6e 64 20 73 68 | a backg|round sh|
|00003b90| 6f 75 6c 64 20 62 65 2e | 0d 0d 54 6f 20 72 65 63 |ould be.|..To rec|
|00003ba0| 61 70 2c 20 74 68 65 20 | 63 6f 64 65 20 74 6f 20 |ap, the |code to |
|00003bb0| 63 72 65 61 74 65 20 74 | 68 65 20 33 20 6c 61 79 |create t|he 3 lay|
|00003bc0| 65 72 73 20 69 73 20 61 | 73 20 66 6f 6c 6c 6f 77 |ers is a|s follow|
|00003bd0| 73 3a 0d 0d 20 20 20 20 | 20 20 20 20 20 20 20 20 |s:.. | |
|00003be0| 20 20 20 20 20 20 20 20 | 4e 65 77 4c 61 79 65 72 | |NewLayer|
|00003bf0| 28 26 77 69 6e 64 6f 77 | 4c 61 79 65 72 2c 20 6e |(&window|Layer, n|
|00003c00| 69 6c 2c 20 6e 69 6c 2c | 20 77 69 6e 64 6f 77 2c |il, nil,| window,|
|00003c10| 20 30 2c 20 30 29 3b 0d | 20 20 20 20 20 20 20 20 | 0, 0);.| |
|00003c20| 20 20 20 20 20 20 65 72 | 72 20 3d 20 4e 65 77 4c | er|r = NewL|
|00003c30| 61 79 65 72 28 26 77 6f | 72 6b 4c 61 79 65 72 2c |ayer(&wo|rkLayer,|
|00003c40| 20 77 69 6e 64 6f 77 4c | 61 79 65 72 2c 20 57 6f | windowL|ayer, Wo|
|00003c50| 72 6b 4c 61 79 65 72 50 | 72 6f 63 2c 20 6e 69 6c |rkLayerP|roc, nil|
|00003c60| 2c 20 30 2c 20 28 6c 6f | 6e 67 29 26 6d 79 49 6e |, 0, (lo|ng)&myIn|
|00003c70| 66 6f 29 3b 0d 20 20 20 | 20 69 66 20 28 21 65 72 |fo);. | if (!er|
|00003c80| 72 29 20 65 72 72 20 3d | 20 4e 65 77 4c 61 79 65 |r) err =| NewLaye|
|00003c90| 72 28 26 62 61 63 6b 4c | 61 79 65 72 2c 20 77 6f |r(&backL|ayer, wo|
|00003ca0| 72 6b 4c 61 79 65 72 2c | 20 42 61 63 6b 4c 61 79 |rkLayer,| BackLay|
|00003cb0| 65 72 50 72 6f 63 2c 20 | 6e 69 6c 2c 20 30 2c 20 |erProc, |nil, 0, |
|00003cc0| 28 6c 6f 6e 67 29 26 6d | 79 49 6e 66 6f 29 3b 0d |(long)&m|yInfo);.|
|00003cd0| 0d 46 6f 72 20 64 72 61 | 67 67 69 6e 67 2c 20 77 |.For dra|gging, w|
|00003ce0| 65 20 77 6f 75 6c 64 20 | 74 68 65 6e 20 68 61 76 |e would |then hav|
|00003cf0| 65 20 73 6f 6d 65 20 73 | 6f 72 74 20 6f 66 20 6c |e some s|ort of l|
|00003d00| 6f 6f 70 2c 20 73 75 63 | 68 20 61 73 3a 0d 0d 20 |oop, suc|h as:.. |
|00003d10| 20 20 20 41 73 73 75 6d | 65 20 74 68 65 20 6c 6f | Assum|e the lo|
|00003d20| 63 61 74 69 6f 6e 20 77 | 68 65 72 65 20 74 68 65 |cation w|here the|
|00003d30| 20 75 73 65 72 20 63 6c | 69 63 6b 65 64 20 69 73 | user cl|icked is|
|00003d40| 20 61 6c 72 65 61 64 79 | 20 69 6e 20 6d 6f 75 73 | already| in mous|
|00003d50| 65 4c 6f 63 2c 20 6c 6f | 63 61 6c 20 63 6f 6f 72 |eLoc, lo|cal coor|
|00003d60| 64 69 6e 61 74 65 73 2e | 0d 0d 20 20 20 20 69 66 |dinates.|.. if|
|00003d70| 20 28 65 72 72 29 20 72 | 65 74 75 72 6e 3b 20 20 | (err) r|eturn; |
|00003d80| 20 20 20 20 20 20 4e 6f | 20 72 61 6d 20 66 6f 72 | No| ram for|
|00003d90| 20 74 68 65 20 6f 66 66 | 73 63 72 65 65 6e 20 73 | the off|screen s|
|00003da0| 74 75 66 66 2e 0d 0d 20 | 20 20 20 6c 61 73 74 4c |tuff... | lastL|
|00003db0| 6f 63 2e 68 20 3d 20 6c | 61 73 74 4c 6f 63 2e 76 |oc.h = l|astLoc.v|
|00003dc0| 20 3d 20 2d 33 32 37 36 | 37 3b 20 20 20 20 20 55 | = -3276|7; U|
|00003dd0| 6e 63 6c 69 63 6b 61 62 | 6c 65 20 69 6e 69 74 69 |nclickab|le initi|
|00003de0| 61 6c 20 70 6f 69 6e 74 | 2e 0d 20 20 20 20 77 68 |al point|.. wh|
|00003df0| 69 6c 65 20 28 53 74 69 | 6c 6c 44 6f 77 6e 28 29 |ile (Sti|llDown()|
|00003e00| 29 20 7b 0d 20 20 20 20 | 20 20 20 20 69 66 20 28 |) {. | if (|
|00003e10| 28 6c 61 73 74 4c 6f 63 | 2e 68 20 21 3d 20 6d 6f |(lastLoc|.h != mo|
|00003e20| 75 73 65 4c 6f 63 2e 68 | 29 20 7c 7c 20 28 6c 61 |useLoc.h|) || (la|
|00003e30| 73 74 4c 6f 63 2e 76 20 | 21 3d 20 6d 6f 75 73 65 |stLoc.v |!= mouse|
|00003e40| 4c 6f 63 2e 76 29 29 20 | 7b 20 20 41 6c 77 61 79 |Loc.v)) |{ Alway|
|00003e50| 73 20 74 72 75 65 20 66 | 69 72 73 74 20 74 69 6d |s true f|irst tim|
|00003e60| 65 2e 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 72 |e.. | r|
|00003e70| 63 74 2e 74 6f 70 20 20 | 3d 20 72 63 74 2e 62 6f |ct.top |= rct.bo|
|00003e80| 74 74 6f 6d 20 3d 20 6d | 6f 75 73 65 4c 6f 63 2e |ttom = m|ouseLoc.|
|00003e90| 76 3b 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 72 |v;. | r|
|00003ea0| 63 74 2e 6c 65 66 74 20 | 3d 20 72 63 74 2e 72 69 |ct.left |= rct.ri|
|00003eb0| 67 68 74 20 20 3d 20 6d | 6f 75 73 65 4c 6f 63 2e |ght = m|ouseLoc.|
|00003ec0| 68 3b 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 72 |h;. | r|
|00003ed0| 63 74 2e 62 6f 74 74 6f | 6d 20 2b 3d 20 6d 79 49 |ct.botto|m += myI|
|00003ee0| 6e 66 6f 2e 6f 62 6a 65 | 63 74 48 65 69 67 68 74 |nfo.obje|ctHeight|
|00003ef0| 3b 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 72 63 |;. | rc|
|00003f00| 74 2e 72 69 67 68 74 20 | 20 2b 3d 20 6d 79 49 6e |t.right | += myIn|
|00003f10| 66 6f 2e 6f 62 6a 65 63 | 74 57 69 64 74 68 3b 0d |fo.objec|tWidth;.|
|00003f20| 20 20 20 20 20 20 20 20 | 20 20 20 20 49 6e 76 61 | | Inva|
|00003f30| 6c 4c 61 79 65 72 28 77 | 69 6e 64 6f 77 4c 61 79 |lLayer(w|indowLay|
|00003f40| 65 72 2c 20 72 63 74 2c | 20 74 72 75 65 29 3b 20 |er, rct,| true); |
|00003f50| 20 20 20 20 55 70 64 61 | 74 65 20 6c 61 73 74 20 | Upda|te last |
|00003f60| 6c 6f 63 61 74 69 6f 6e | 2c 20 61 73 20 77 65 6c |location|, as wel|
|00003f70| 6c 20 61 73 20 74 68 69 | 73 20 6f 6e 65 2e 0d 20 |l as thi|s one.. |
|00003f80| 20 20 20 20 20 20 20 20 | 20 20 20 55 70 64 61 74 | | Updat|
|00003f90| 65 4c 61 79 65 72 28 77 | 69 6e 64 6f 77 4c 61 79 |eLayer(w|indowLay|
|00003fa0| 65 72 29 3b 0d 20 20 20 | 20 20 20 20 20 20 20 20 |er);. | |
|00003fb0| 20 6c 61 73 74 4c 6f 63 | 20 3d 20 6d 6f 75 73 65 | lastLoc| = mouse|
|00003fc0| 4c 6f 63 3b 0d 20 20 20 | 20 20 20 20 20 7d 0d 20 |Loc;. | }. |
|00003fd0| 20 20 20 7d 0d 0d 20 20 | 20 20 44 69 73 70 6f 73 | }.. | Dispos|
|00003fe0| 65 54 68 69 73 41 6e 64 | 42 65 6c 6f 77 4c 61 79 |eThisAnd|BelowLay|
|00003ff0| 65 72 73 28 77 69 6e 64 | 6f 77 4c 61 79 65 72 29 |ers(wind|owLayer)|
|00004000| 3b 0d 0d 41 73 20 63 61 | 6e 20 62 65 20 73 65 65 |;..As ca|n be see|
|00004010| 6e 20 61 62 6f 76 65 2c | 20 73 6d 6f 6f 74 68 6c |n above,| smoothl|
|00004020| 79 20 64 72 61 67 67 69 | 6e 67 20 61 6e 20 6f 62 |y draggi|ng an ob|
|00004030| 6a 65 63 74 20 63 61 6e | 20 62 65 20 76 65 72 79 |ject can| be very|
|00004040| 20 6c 69 74 74 6c 65 20 | 63 6f 64 65 2e 20 20 54 | little |code. T|
|00004050| 68 65 72 65 20 61 72 65 | 20 61 20 66 65 77 0d 74 |here are| a few.t|
|00004060| 68 69 6e 67 73 20 6e 6f | 74 20 68 61 6e 64 6c 65 |hings no|t handle|
|00004070| 64 20 62 79 20 74 68 65 | 20 61 62 6f 76 65 20 63 |d by the| above c|
|00004080| 6f 64 65 2c 20 73 75 63 | 68 20 61 73 20 69 66 20 |ode, suc|h as if |
|00004090| 74 68 65 72 65 20 69 73 | 6e 27 74 20 65 6e 6f 75 |there is|n't enou|
|000040a0| 67 68 20 6d 65 6d 6f 72 | 79 20 66 6f 72 20 74 68 |gh memor|y for th|
|000040b0| 65 20 6f 66 66 73 63 72 | 65 65 6e 0d 47 57 6f 72 |e offscr|een.GWor|
|000040c0| 6c 64 73 2e 20 20 49 74 | 20 69 73 6e 27 74 20 72 |lds. It| isn't r|
|000040d0| 65 61 6c 6c 79 20 70 6f | 6c 69 74 65 20 74 6f 20 |eally po|lite to |
|000040e0| 64 6f 20 6e 6f 74 68 69 | 6e 67 2c 20 61 73 20 74 |do nothi|ng, as t|
|000040f0| 68 65 20 61 62 6f 76 65 | 20 63 6f 64 65 20 64 6f |he above| code do|
|00004100| 65 73 2e 20 20 46 6f 72 | 20 65 78 63 65 70 74 69 |es. For| excepti|
|00004110| 6f 6e 0d 68 61 6e 64 6c | 69 6e 67 2c 20 70 6c 65 |on.handl|ing, ple|
|00004120| 61 73 65 20 73 65 65 20 | 74 68 65 20 61 63 74 75 |ase see |the actu|
|00004130| 61 6c 20 73 61 6d 70 6c | 65 20 63 6f 64 65 20 74 |al sampl|e code t|
|00004140| 68 61 74 20 75 73 65 73 | 20 74 68 65 20 47 57 4c |hat uses| the GWL|
|00004150| 61 79 65 72 73 2e 63 20 | 70 61 63 6b 61 67 65 2e |ayers.c |package.|
|00004160| 20 0d 0d 0d 01 2e 00 0f | 00 00 00 00 00 0b 00 09 | .......|........|
|00004170| 00 04 00 00 00 09 00 00 | 00 00 00 00 00 00 1c 4d |........|.......M|
|00004180| 00 0b 00 09 00 04 05 00 | 00 09 00 00 00 00 00 00 |........|........|
|00004190| 00 00 1c 58 00 0b 00 09 | 00 04 00 00 00 09 00 00 |...X....|........|
|000041a0| 00 00 00 00 00 00 25 eb | 00 0b 00 09 00 04 05 00 |......%.|........|
|000041b0| 00 09 00 00 00 00 00 00 | 00 00 25 f5 00 0b 00 09 |........|..%.....|
|000041c0| 00 04 00 00 00 09 00 00 | 00 00 00 00 00 00 25 f8 |........|......%.|
|000041d0| 00 0b 00 09 00 04 05 00 | 00 09 00 00 00 00 00 00 |........|........|
|000041e0| 00 00 26 02 00 0b 00 09 | 00 04 00 00 00 09 00 00 |..&.....|........|
|000041f0| 00 00 00 00 00 00 27 5f | 00 0b 00 09 00 04 05 00 |......'_|........|
|00004200| 00 09 00 00 00 00 00 00 | 00 00 27 6a 00 0b 00 09 |........|..'j....|
|00004210| 00 04 00 00 00 09 00 00 | 00 00 00 00 00 00 3b cc |........|......;.|
|00004220| 00 0b 00 09 00 04 05 00 | 00 09 00 00 00 00 00 00 |........|........|
|00004230| 00 00 3b d6 00 0b 00 09 | 00 04 00 00 00 09 00 00 |..;.....|........|
|00004240| 00 00 00 00 00 00 3c 2b | 00 0b 00 09 00 04 05 00 |......<+|........|
|00004250| 00 09 00 00 00 00 00 00 | 00 00 3c 36 00 0b 00 09 |........|..<6....|
|00004260| 00 04 00 00 00 09 00 00 | 00 00 00 00 00 00 3c 7a |........|......<z|
|00004270| 00 0b 00 09 00 04 05 00 | 00 09 00 00 00 00 00 00 |........|........|
|00004280| 00 00 3c 93 00 0b 00 09 | 00 04 00 00 00 09 00 00 |..<.....|........|
|00004290| 00 00 00 00 | |.... | |
+--------+-------------------------+-------------------------+--------+--------+